summaryrefslogtreecommitdiffstats
path: root/pym/repoman/utilities.py
Commit message (Collapse)AuthorAgeFilesLines
* repoman: fix Unicode unequal comparison warningZac Medico2012-09-101-1/+1
|
* repoman: fix getstatusoutput more, bug #310789Zac Medico2012-09-091-10/+22
|
* repoman: handle trailing newlines betterMike Frysinger2012-06-121-3/+8
| | | | | | | | Automatically strip trailing newlines from the ChangeLog, and be better about not adding them in the first place (still not perfect, but getting there). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* repoman: update cat/pkg info in header all the timeMike Frysinger2012-06-121-25/+32
| | | | | | | | | | | There are edge cases where repoman's changelog code is not as good as the existing echangelog. Mostly related to out of date headers. Have the code check the header in more cases not just for missing lines, but also outdated values all the time. While we're at it, write some tests! Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Replace @returns with @return.Zac Medico2012-03-271-3/+3
|
* repoman: support overlays without repo_nameZac Medico2012-03-041-1/+32
|
* Use portage.shutil for safer unicode handling.Zac Medico2011-12-101-1/+1
|
* repoman: fix svn "abiguous workdir", bug #391199v2.2.0_alpha77Zac Medico2011-11-211-0/+4
|
* UpdateChangeLog: sort filesZac Medico2011-10-261-0/+4
|
* UpdateChangeLog: tweak clold_lines logicZac Medico2011-10-211-14/+17
| | | | There are two cases here that have to be mutually exclusive.
* update_copyright: make pretend a keyword argZac Medico2011-10-211-2/+2
|
* _update_copyright_year: optimize no-match caseZac Medico2011-10-211-1/+8
|
* update_copyright: process files as raw bytesZac Medico2011-10-211-10/+20
| | | | | This function will work correctly with files encoded in any character set, as long as the copyright statements consist of plain ASCII.
* UpdateChangeLog: split out/test copyright regexZac Medico2011-10-201-12/+28
| | | | | This also fixes a case where something like "Copyright 2011 " would be replaced with "Copyright 2011-2011 ".
* UpdateChangeLog: tweak new/changed codedZac Medico2011-10-201-9/+8
|
* UpdateChangeLog: split out get_committer_name()Zac Medico2011-10-201-20/+24
|
* UpdateChangeLog: handle edge casesZac Medico2011-10-201-10/+28
| | | | | This should handle all kinds of variance in the input ChangeLog and skel.ChangeLog.
* UpdateChangeLog: don't hardcode 1999 copyrightZac Medico2011-10-201-2/+2
| | | | | | 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.
* update_copyright: remove stray semicolonZac Medico2011-10-201-1/+1
|
* 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().