From: Zac Medico Date: Sat, 17 Jun 2006 15:56:09 +0000 (-0000) Subject: Force digest generation when assume-digests is enabled but the file size does not... X-Git-Tag: v2.1.1~477 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e7f711de30928cf0762d7c694091467ab5a9d191;p=portage.git Force digest generation when assume-digests is enabled but the file size does not match. See bug #137032. svn path=/main/trunk/; revision=3517 --- 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: