Force digest generation when assume-digests is enabled but the file size does not...
authorZac Medico <zmedico@gentoo.org>
Wed, 21 Jun 2006 02:29:43 +0000 (02:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 21 Jun 2006 02:29:43 +0000 (02:29 -0000)
svn path=/main/branches/2.1/; revision=3566

pym/portage_manifest.py

index e484d9e37350a4cb15ac4788158209e9e9c99226..13c6932d2d6c474dde270dbb5be77263186015b3 100644 (file)
@@ -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: