summaryrefslogtreecommitdiffstats
path: root/pym/repoman/utilities.py
Commit message (Collapse)AuthorAgeFilesLines
* update_copyright: don't hardcode 1999 start yearZac Medico2011-10-201-4/+5
| | | | | | We want repoman to be applicable to as many repositories as possible. If necessary, we can add another layout.conf attribute that configures the copyright start years for all files.
* UpdateChangeLog: fix whitespaceFabian Groffen2011-10-201-2/+2
|
* repoman: update copyright on modified filesFabian Groffen2011-10-201-6/+85
| | | | | | To retain the behaviour of echangelog, update the copyrights on modified files (mostly ebuilds) when necessary. Also update the ChangeLog's copyright.
* repoman: get ChangeLog header from skel.ChangeLogFabian Groffen2011-10-201-36/+43
| | | | | | | Use skel.ChangeLog from the repo to create the header of a new ChangeLog file. Else, we just retain the original header of the ChangeLog. When no skel.ChangeLog file exists, and this is a new ChangeLog, no header is used.
* UpdateChangeLog: time in UTCZac Medico2011-10-201-3/+5
|
* UpdateChangeLog: use struct_passwd attributesZac Medico2011-10-171-3/+3
|
* UpdateChangeLog: show trivial if nothing elseZac Medico2011-10-161-5/+20
| | | | | Like echangelog does, show ChangeLog or Manifest if there are no other changes to display.
* UpdateChangeLog: update copyright year in headerZac Medico2011-10-161-2/+10
| | | | | This feature got dropped on commit b655137b7b5f87c11a7e742b7ef0e028a1139677.
* UpdateChangeLog: optimize and add unicode supportZac Medico2011-10-161-32/+70
| | | | | | | | Also: * copy the old header from the old ChangeLog if it exists, in case it contains a non-gentoo header * don't add a header if the old ChangeLog exists and doesn't contain a header
* repoman: implemented echangelog functionalityFabian Groffen2011-10-161-2/+120
| | | | | | | | | | Instead of calling echangelog, which on its turn has to query the VCS again, use the existing information on changes made to the current directory, and update the ChangeLog from Python itself. This avoids a call to echangelog, and avoids again retrieving the same VCS information as repoman already did. It makes repoman independent from external tools it didn't install itself, and should be faster in general.
* FindVCS: support Subversion 1.7Fabian Groffen2011-10-151-2/+4
| | | | | Since subversion 1.7, only a top-level .svn dir is used. Make FindVCS also deal with that. (Tested with repoman on Prefix SVN-based tree.)
* repoman: discard STDERR output from CVS.Michał Górny2011-08-301-1/+1
| | | | Fixes: https://bugs.gentoo.org/show_bug.cgi?id=373669
* 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