summaryrefslogtreecommitdiffstats
path: root/pym/portage_manifest.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-05-04 02:44:01 +0000
committerZac Medico <zmedico@gentoo.org>2006-05-04 02:44:01 +0000
commitb00fd7dfc9eef9e389d9dd7fe1f2839132ba0c59 (patch)
tree42eb68a0080c0cad9280da11d606781c37f37888 /pym/portage_manifest.py
parent866a2eaa0e298efafb59d4a8e5bd470af13007f3 (diff)
downloadportage-b00fd7dfc9eef9e389d9dd7fe1f2839132ba0c59.tar.gz
portage-b00fd7dfc9eef9e389d9dd7fe1f2839132ba0c59.tar.bz2
portage-b00fd7dfc9eef9e389d9dd7fe1f2839132ba0c59.zip
Bring back FEATURES="assume-digests" for bug #132182.
svn path=/main/trunk/; revision=3317
Diffstat (limited to 'pym/portage_manifest.py')
-rw-r--r--pym/portage_manifest.py33
1 files changed, 20 insertions, 13 deletions
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py
index 856ba6fbc..669ee6067 100644
--- a/pym/portage_manifest.py
+++ b/pym/portage_manifest.py
@@ -400,16 +400,19 @@ class Manifest(object):
return t
return None
- def create(self, checkExisting=False, assumeDistfileHashes=True, requiredDistfiles=None):
- """ Recreate this Manifest from scratch, not using any existing checksums
- (exception: if assumeDistfileHashes is true then existing DIST checksums are
- reused if the file doesn't exist in DISTDIR. The requiredDistfiles
- parameter specifies a list of distfiles to raise a FileNotFound
- exception for (if no file or existing checksums are available), and
- defaults to all distfiles when not specified."""
+ def create(self, checkExisting=False, assumeDistHashesSometimes=False,
+ assumeDistHashesAlways=False, requiredDistfiles=None):
+ """ Recreate this Manifest from scratch. This will not use any
+ existing checksums unless assumeDistHashesSometimes or
+ assumeDistHashesAlways is true (assumeDistHashesSometimes will only
+ cause DIST checksums to be reused if the file doesn't exist in
+ DISTDIR). The requiredDistfiles parameter specifies a list of
+ distfiles to raise a FileNotFound exception for (if no file or existing
+ checksums are available), and defaults to all distfiles when not
+ specified."""
if checkExisting:
self.checkAllHashes()
- if assumeDistfileHashes:
+ if assumeDistHashesSometimes or assumeDistHashesAlways:
distfilehashes = self.fhashdict["DIST"]
else:
distfilehashes = {}
@@ -446,12 +449,16 @@ class Manifest(object):
requiredDistfiles = distlist.copy()
for f in distlist:
fname = os.path.join(self.distdir, f)
- if os.path.exists(fname):
- self.fhashdict["DIST"][f] = perform_multiple_checksums(fname, self.hashes)
- elif assumeDistfileHashes and f in distfilehashes:
+ if f in distfilehashes and (assumeDistHashesAlways or \
+ (assumeDistHashesSometimes and not os.path.exists(fname))):
self.fhashdict["DIST"][f] = distfilehashes[f]
- elif f in requiredDistfiles:
- raise FileNotFound(fname)
+ else:
+ try:
+ self.fhashdict["DIST"][f] = perform_multiple_checksums(fname, self.hashes)
+ except FileNotFound:
+ if f in requiredDistfiles:
+ raise
+
def _pkgdir_category(self):
return self.pkgdir.rstrip(os.sep).split(os.sep)[-2]