Fix FileNotFound error when ignoreMissing=True for bug #130928.
authorZac Medico <zmedico@gentoo.org>
Sun, 23 Apr 2006 07:23:40 +0000 (07:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 23 Apr 2006 07:23:40 +0000 (07:23 -0000)
svn path=/main/trunk/; revision=3194

pym/portage_manifest.py

index 1320ba235dfd4ca28df675b62537f3606df507cc..1ca793c80fe501a1dd24a070543baa0508903286 100644 (file)
@@ -465,10 +465,15 @@ class Manifest(object):
        
        def checkFileHashes(self, ftype, fname, ignoreMissing=False):
                myhashes = self.fhashdict[ftype][fname]
-               ok,reason = verify_all(self._getAbsname(ftype, fname), self.fhashdict[ftype][fname])
-               if not ok:
-                       raise DigestException(tuple([self._getAbsname(ftype, fname)]+list(reason)))
-               return ok, reason
+               try:
+                       ok,reason = verify_all(self._getAbsname(ftype, fname), self.fhashdict[ftype][fname])
+                       if not ok:
+                               raise DigestException(tuple([self._getAbsname(ftype, fname)]+list(reason)))
+                       return ok, reason
+               except FileNotFound, e:
+                       if not ignoreMissing:
+                               raise
+                       return False, "File Not Found: '%s'" % str(e)
 
        def checkCpvHashes(self, cpv, checkDistfiles=True, onlyDistfiles=False, checkMiscfiles=False):
                """ check the hashes for all files associated to the given cpv, include all