diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-07-21 11:34:23 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-07-21 11:34:23 +0000 |
commit | 6e3a6a8b9cb8477afb12497b43f8f58c06a90128 (patch) | |
tree | 99534d9b21720c5560715bc875fd16069a7caed4 | |
parent | db5c717ee9b67fcd5460bbe8820078b2d32bb222 (diff) | |
download | portage-6e3a6a8b9cb8477afb12497b43f8f58c06a90128.tar.gz portage-6e3a6a8b9cb8477afb12497b43f8f58c06a90128.tar.bz2 portage-6e3a6a8b9cb8477afb12497b43f8f58c06a90128.zip |
For bug #169500, detect when the cvs server puts /Attic/ inside the $Header path and automatically correct it.
svn path=/main/trunk/; revision=7340
-rwxr-xr-x | bin/repoman | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman index 6a617191d..b995c4706 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1792,6 +1792,23 @@ else: else: raise portage.exception.PortageException("!!! gpg exited with '" + str(rValue) + "' status") + # When files are removed and re-added, the cvs server will put /Attic/ + # inside the $Header path. This code detects the problem and corrects it + # so that the Manifest will generate correctly. See bug #169500. + from portage.util import write_atomic + cvs_header = re.compile(r'^#\s*\$Header.*\$$') + for x in myheaders: + f = open(x) + mylines = f.readlines() + f.close() + modified = False + for i, line in enumerate(mylines): + if cvs_header.match(line) and "/Attic/" in line: + mylines[i] = line.replace("/Attic/", "/") + modified = True + if modified: + write_atomic(x, "".join(mylines)) + manifest_commit_required = True if myheaders or myupdates or myremoved or mynew: myfiles=myheaders+myupdates+myremoved+mynew |