From e7f711de30928cf0762d7c694091467ab5a9d191 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 17 Jun 2006 15:56:09 +0000 Subject: Force digest generation when assume-digests is enabled but the file size does not match. See bug #137032. svn path=/main/trunk/; revision=3517 --- pym/portage_manifest.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pym/portage_manifest.py') diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py index e484d9e37..13c6932d2 100644 --- a/pym/portage_manifest.py +++ b/pym/portage_manifest.py @@ -450,8 +450,16 @@ class Manifest(object): requiredDistfiles = distlist.copy() for f in distlist: fname = os.path.join(self.distdir, f) - if f in distfilehashes and (assumeDistHashesAlways or \ - (assumeDistHashesSometimes and not os.path.exists(fname))): + mystat = None + try: + mystat = os.stat(fname) + except OSError: + pass + if f in distfilehashes and \ + ((assumeDistHashesSometimes and mystat is None) or \ + (assumeDistHashesAlways and mystat is None) or \ + (assumeDistHashesAlways and mystat is not None and \ + distfilehashes[f]["size"] == mystat.st_size)): self.fhashdict["DIST"][f] = distfilehashes[f] else: try: -- cgit v1.2.3-1-g7c22