Ignore ENOENT errors when $FILESDIR doesn't exist. Thanks to Christian Heim for...
authorZac Medico <zmedico@gentoo.org>
Mon, 17 Apr 2006 19:57:32 +0000 (19:57 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 17 Apr 2006 19:57:32 +0000 (19:57 -0000)
svn path=/main/trunk/; revision=3171

pym/portage_manifest.py

index b062c70ab3f1d4b1be019a5c59abfc00ac04a40e..1b7135c97b39741827b0b486a14631b97736a561 100644 (file)
@@ -137,10 +137,16 @@ class Manifest(object):
                """ Parse old style digest files for this Manifest instance """
                if myhashdict is None:
                        myhashdict = {}
-               for d in os.listdir(os.path.join(self.pkgdir, "files")):
-                       if d.startswith("digest-"):
-                               self._readManifest(os.path.join(self.pkgdir, "files", d), mytype="DIST",
-                                       myhashdict=myhashdict)
+               try:
+                       for d in os.listdir(os.path.join(self.pkgdir, "files")):
+                               if d.startswith("digest-"):
+                                       self._readManifest(os.path.join(self.pkgdir, "files", d), mytype="DIST",
+                                               myhashdict=myhashdict)
+               except (IOError, OSError), e:
+                       if e.errno == errno.ENOENT:
+                               pass
+                       else:
+                               raise
                return myhashdict
 
        def _readManifest(self, file_path, myhashdict=None, **kwargs):