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:43:17 +0000 (22:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 17 Jun 2007 22:43:17 +0000 (22:43 -0000)
svn path=/main/branches/2.1.2/; revision=6866

pym/portage.py

index dc54e8abbe6e3964f2100719b08822c77a1aae62..955901a52f32270adecff88c5ba8c7a317301f72 100644 (file)
@@ -7270,15 +7270,18 @@ class dblink:
                """
                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: