From: Zac Medico Date: Wed, 21 Jun 2006 02:29:43 +0000 (-0000) Subject: Force digest generation when assume-digests is enabled but the file size does not... X-Git-Tag: v2.1-r1~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=02d002cad1ee0a71e6cf62c32418fca9a2618306;p=portage.git Force digest generation when assume-digests is enabled but the file size does not match. See bug #137032. This patch is from trunk r3517. svn path=/main/branches/2.1/; revision=3566 --- 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: