From 7024d936a18a74abf716bc5b0debaa26d3b2dba3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 31 Jul 2006 15:39:37 +0000 Subject: [PATCH] When assume-digests is enabled, for digest generation if the number of parsed digests does not match the number of digest types that are supported for bug #138911. This patch is from trunk r3771:3773. svn path=/main/branches/2.1/; revision=4058 --- pym/portage.py | 16 +++++++++------- pym/portage_manifest.py | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index dad2583bc..a98fc883d 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2925,13 +2925,15 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, fetchme = alluris[:] checkme = aalist[:] # Skip files that we already have digests for. - mydigests = Manifest( - mysettings["O"], mysettings["DISTDIR"]).getTypeDigests("DIST") - for x in mydigests: - while x in checkme: - i = checkme.index(x) - del fetchme[i] - del checkme[i] + mf = Manifest(mysettings["O"], mysettings["DISTDIR"]) + mydigests = mf.getTypeDigests("DIST") + for filename, hashes in mydigests.iteritems(): + if len(hashes) == len(mf.hashes): + while filename in checkme: + i = checkme.index(filename) + del fetchme[i] + del checkme[i] + del filename, hashes else: fetchme=newuris[:] checkme=alist[:] diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py index 13c6932d2..ee9b4b833 100644 --- a/pym/portage_manifest.py +++ b/pym/portage_manifest.py @@ -459,6 +459,7 @@ class Manifest(object): ((assumeDistHashesSometimes and mystat is None) or \ (assumeDistHashesAlways and mystat is None) or \ (assumeDistHashesAlways and mystat is not None and \ + len(distfilehashes[f]) == len(self.hashes) and \ distfilehashes[f]["size"] == mystat.st_size)): self.fhashdict["DIST"][f] = distfilehashes[f] else: -- 2.26.2