summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-10-03 16:53:10 -0700
committerZac Medico <zmedico@gentoo.org>2012-10-03 16:53:10 -0700
commit916df01c378dc4a04961effdc209dab791d3e53f (patch)
tree9e010ba17b782864cb5695f9a52acac1f37adf99
parent66c95f2ab154f1ac15a4f22b1b5d14ecf2f661ba (diff)
downloadportage-916df01c378dc4a04961effdc209dab791d3e53f.tar.gz
portage-916df01c378dc4a04961effdc209dab791d3e53f.tar.bz2
portage-916df01c378dc4a04961effdc209dab791d3e53f.zip
repoman: avoid Manifest double signaturev2.2.0_alpha135
-rwxr-xr-xbin/repoman12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/repoman b/bin/repoman
index 6caf791de..18a3b30ad 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2765,6 +2765,16 @@ else:
else:
raise portage.exception.PortageException("!!! gpg exited with '" + str(rValue) + "' status")
+ def need_signature(filename):
+ try:
+ with open(_unicode_encode(filename,
+ encoding=_encodings['fs'], errors='strict'), 'rb') as f:
+ return b"BEGIN PGP SIGNED MESSAGE" not in f.readline()
+ except IOError as e:
+ if e.errno in (errno.ENOENT, errno.ESTALE):
+ return False
+ raise
+
# 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.
@@ -2807,7 +2817,7 @@ else:
chain(myupdates, myremoved, mymanifests))):
repoman_settings["O"] = os.path.join(repodir, x)
manifest_path = os.path.join(repoman_settings["O"], "Manifest")
- if not os.path.exists(manifest_path):
+ if not need_signature(manifest_path):
continue
gpgsign(manifest_path)
except portage.exception.PortageException as e: