summaryrefslogtreecommitdiffstats
path: root/pym/repoman/utilities.py
Commit message (Collapse)AuthorAgeFilesLines
* Migrate from codecs.open() to io.open().Zac Medico2011-07-101-3/+3
| | | | | | | | | | | | | | | | | The io.open() function is the same as the built-in open() function in python3, and its implementation is optimized in python-2.7 and later. In addition to the possible performance improvement, this also allows us to avoid any future compatibility issues with codecs.open() that may arise if it is delegated to the built-in open() function as discussed in PEP 400. The main caveat involved with io.open() is that TextIOWrapper.write() raises TypeError if given raw bytes, unlike the streams returned from codecs.open(). This is mainly an issue for python2 since literal strings are raw bytes. We handle this by wrapping TextIOWrapper.write() arguments with our _unicode_decode() function. Also, the atomic_ofstream class overrides the write() method in python2 so that it performs automatic coercion to unicode when necessary.
* Revert "parse_metadata_use(): omit empty text tokens."Zac Medico2011-02-041-2/+1
| | | | | | This reverts commit 52f6b55d51e2accaa446bc5d6920421959289baa. Since split() never return empty tokens, this patch does nothing.
* parse_metadata_use(): omit empty text tokens.Michał Górny2011-02-031-1/+2
|
* Use bytes literals.Arfrever Frehtes Taifersar Arahesis2010-12-061-4/+4
|
* Allow repoman to commit files, which have changes only in SVN properties.Arfrever Frehtes Taifersar Arahesis2010-10-231-2/+2
|
* Fix parse_metadata_use() to allow use elements containing no flagZac Medico2010-09-061-1/+2
| | | | | elements since the DTD allows it. Thanks to Mark Loeser <Halcy0n@g.o> for reporting.
* Remove unused imports found by pylint.Arfrever Frehtes Taifersar Arahesis2010-08-291-1/+0
|
* Support returning multiple flag descriptions when restrict is used.Michał Górny2010-08-271-8/+6
| | | | | | | Return a dict of dicts in parse_metadata_use(), with second-level keys being the restrict strings (or None when no restrict). When generating use.local.desc, use the description from the possibly-highest-matching atom.
* Various parse_metadata_use() fixes:Zac Medico2010-08-261-25/+35
| | | | | | | * Allow empty descriptions (backward compatibility). * Support multiple 'use' elements. * If multiple 'flag' elements have the same name attribute, use the first occurance.
* Make parse_metadata_use() tolerate empty flag descriptions.Zac Medico2010-08-261-8/+1
|
* Make parse_metadata_use() emulate the Element.itertext() method fromZac Medico2010-08-261-3/+19
| | | | | python-2.7, so egencache --update-use-local-desc gets all of the inner text.
* Fix up error handling for egencache --update-use-local-desc.Zac Medico2010-08-261-2/+6
|
* Parse flag descriptions in repoman.utilities.parse_metadata_use().Michał Górny2010-08-261-5/+12
| | | | | | Grab the USE descriptions from metadata.xml within parse_metadata_use(). Instead of a plain flag list, return a dict containing both the flag names and their descriptions.
* Bug #334265 - Fix AttributeError triggered by empty herd element inZac Medico2010-08-241-1/+1
| | | | check_metadata_herds().
* Add FindVCS() to __all__.Michał Górny2010-07-141-0/+1
|
* repoman: don't complain about stray Manifests.Michał Górny2010-07-121-0/+3
| | | | | As repoman regenerates and readds Manifests anyway, there's no reason to complain when one hasn't been added yet.
* Rewrite VCS detection code in repoman.Michał Górny2010-07-111-0/+44
| | | | | | Move the real code into repoman.utilities. Support any repository depth for distributed SCMs -- i.e. Sunrise through git-svn. Bail out if more than one control version directory is found at the same depth.
* Make metadata.xml <flag/> errors non-fatal to repoman.Michał Górny2010-04-241-4/+2
| | | | | | Previously, <flag/>-related errors in metadata.xml caused repoman to abort the checks without even reporting the full path to broken metadata.xml file. Now they are accounted as 'metadata.bad' errors.
* Pass an ElementTree instance into parse_metadata_use() andZac Medico2010-04-111-16/+2
| | | | check_metadata_herds().
* Port parse_metadata_use() code from minidom to ElementTree.Zac Medico2010-04-111-32/+17
|
* Handle missing $PORTDIR/metadata/herds.xml. Thanks to Arfrever for reporting.Zac Medico2010-04-021-1/+2
|
* Remove all svn $Id keywords.Zac Medico2010-03-241-1/+0
|
* Add check of herds in metadata.xmlSebastian Pipping2010-03-231-1/+32
|
* Prepare further checks on metadata.xmlSebastian Pipping2010-03-231-2/+2
|
* Move the DOM unlink call to a finally block.Zac Medico2010-01-291-18/+20
| | | | svn path=/main/trunk/; revision=15216
* Use list comprehensions instead of filter() or map() in some places for ↵Arfrever Frehtes Taifersar Arahesis2009-09-251-2/+2
| | | | | | compatibility with Python 3. svn path=/main/trunk/; revision=14421
* Use dict.(keys|values|items)() instead of ↵Arfrever Frehtes Taifersar Arahesis2009-09-211-1/+1
| | | | | | | | dict.(iterkeys|itervalues|iteritems)() for compatibility with Python 3. (2to3-3.1 -f dict -nw ${FILES}) svn path=/main/trunk/; revision=14327
* Use filter() and zip() instead of itertools.ifilter() and itertools.izip() ↵Arfrever Frehtes Taifersar Arahesis2009-09-211-2/+1
| | | | | | | | for compatibility with Python 3. (2to3-3.1 -f itertools -f itertools_imports -nw ${FILES}) svn path=/main/trunk/; revision=14314
* Misc unicode fixes for repoman.Zac Medico2009-09-201-7/+12
| | | | svn path=/main/trunk/; revision=14302
* Update system imports for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-3/+6
| | | | svn path=/main/trunk/; revision=14294
* Update syntax of calls to print() for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-1/+1
| | | | | | (2to3-3.1 -f print -nw ${FILES}) svn path=/main/trunk/; revision=14290
* Update syntax of 'except' statements for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-2/+2
| | | | | | (2to3-3.1 -f except -nw ${FILES}) svn path=/main/trunk/; revision=14289
* Bug #283292 - Fix FindPortdir() to prevent OSError: [Errno 2] from stat whenZac Medico2009-08-311-1/+1
| | | | | | $PWD is unset. Thanks to Jonathan Callen <en.ABCD@gmail.com> for this patch. svn path=/main/trunk/; revision=14174
* Use portage.os and _encodings where appropriate.Zac Medico2009-08-191-2/+8
| | | | svn path=/main/trunk/; revision=14097
* Add a new portage.util.shlex_split() function to wrap all shlex.split() calls,Zac Medico2009-08-061-3/+2
| | | | | | since shlex.split() doesn't behave well with unicode strings. svn path=/main/trunk/; revision=13939
* Bug #247548 - Remove 'last' and 'lfull' commands since nobody uses them.Zac Medico2008-11-231-1/+1
| | | | | | Thanks to Alec Warner <antarus@g.o>. svn path=/main/trunk/; revision=12049
* Make FindPortdir() fall back to have_profile_dir() checks if it can't matchZac Medico2008-11-111-6/+20
| | | | | | | | the current location with anything from PORTDIR_OVERLAY. Assume that an overlay will contain at least a "repo_name" file while a master repo (portdir) will contain at least a "profiles.desc" file. svn path=/main/trunk/; revision=11855
* Make FindPortdir() return (None, None, None) on failure, instead of raisingZac Medico2008-11-111-1/+1
| | | | | | a potentially ambiguous ValueError. svn path=/main/trunk/; revision=11853
* Inside have_profile_dir(), check for existence of profiles.desc since thatZac Medico2008-11-111-1/+1
| | | | | | makes a little more sense thatn checking for package.mask. svn path=/main/trunk/; revision=11852
* * Fix parse_metadata_use() to raise ParseError instead of the ExpatErrorZac Medico2008-08-141-1/+17
| | | | | | | | that was reported by grobian. * Define __all__. svn path=/main/trunk/; revision=11407
* Remove unused parse_use_local_desc() function.Zac Medico2008-08-051-22/+0
| | | | svn path=/main/trunk/; revision=11330
* Bug #199788 - Make repoman parse GLEP 56 USE flag descriptions fromZac Medico2008-07-181-0/+33
| | | | | | | metadata.xml (in addition to use.local.desc). Thanks to Doug Goldstein <cardoe@g.o> for this patch. svn path=/main/trunk/; revision=11126
* Fix a few typos found with pyflakes. Thanks to Cardoe for reporting.Zac Medico2008-07-111-3/+5
| | | | svn path=/main/trunk/; revision=11018
* Add subversion support for repoman (patch by Fabien Groffen, ↵Marius Mauch2008-05-131-6/+15
| | | | | | http://archives.gentoo.org/gentoo-portage-dev/msg_b7080f212c3eb09c943a1ce5a7356f01.xml) svn path=/main/trunk/; revision=10325
* Various repoman fixes, plus a weird lockfile tracekback in news.Alec Warner2008-02-241-2/+4
| | | | svn path=/main/trunk/; revision=9377
* Bug #211067 - Make the "portdir_overlay" and "mydir" variables containZac Medico2008-02-221-4/+6
| | | | | | | | | | paths that are consistent wrt eachother regardless of any path irregularities that can be induced by symlinks. Consistency is achieved by regenerating one of the paths to ensure that both paths have the exact same mapping between inodes and paths. This consistency ensures that the path manipulations used to calculate "repolevel" will work as intended. svn path=/main/trunk/; revision=9365
* fix more trivial issues breaking repomanv2.2_pre2Marius Mauch2008-02-101-1/+2
| | | | svn path=/main/trunk/; revision=9328
* Pull more functions out of repoman proper and into repoman.utilitiesAlec Warner2008-01-271-2/+178
| | | | svn path=/main/trunk/; revision=9226
* Move random functions out of repoman and into utilties.pyAlec Warner2008-01-261-0/+188
svn path=/main/trunk/; revision=9221