In dblink.isowner() don't bother to stat the file when it's contained in the contents.
authorZac Medico <zmedico@gentoo.org>
Sun, 17 Jun 2007 22:42:52 +0000 (22:42 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 17 Jun 2007 22:42:52 +0000 (22:42 -0000)
svn path=/main/trunk/; revision=6865

pym/portage/dbapi/vartree.py

index 3920fd0964ca448c671f5216a1efe8b4b63304ab..dcc673c796ff6ff472480fcbef7e4d38ab4cd9b1 100644 (file)
@@ -1305,15 +1305,18 @@ class dblink(object):
                """
                destfile = normalize_path(
                        os.path.join(destroot, filename.lstrip(os.path.sep)))
-               try:
-                       mylstat = os.lstat(destfile)
-               except (OSError, IOError):
-                       return True
 
                pkgfiles = self.getcontents()
                if pkgfiles and destfile in pkgfiles:
                        return True
                if pkgfiles:
+                       try:
+                               mylstat = os.lstat(destfile)
+                       except EnvironmentError, e:
+                               if e.errno != errno.ENOENT:
+                                       raise
+                               del e
+                               return True
                        if self._contents_inodes is None:
                                self._contents_inodes = set()
                                for x in pkgfiles: