Make the .installed invalidation conditional on srcroot and destroot being located...
authorZac Medico <zmedico@gentoo.org>
Sun, 8 Oct 2006 22:23:20 +0000 (22:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 8 Oct 2006 22:23:20 +0000 (22:23 -0000)
svn path=/main/trunk/; revision=4623

pym/portage.py

index 3fd1dc33742d7685bcbc00b6f32c12aa49a4e0d1..1a6aa256d6822e1f17bd64cd290481f56dd4882d 100644 (file)
@@ -6029,15 +6029,16 @@ class dblink:
                # This blocks until we can get the dirs to ourselves.
                self.lockdb()
 
-               try:
+               if os.stat(srcroot).st_dev == os.stat(destroot).st_dev:
                        """ The merge process may move files out of the image directory,
                        which causes invalidation of the .installed flag."""
-                       os.unlink(os.path.join(
-                               os.path.dirname(normalize_path(srcroot)), ".installed"))
-               except OSError, e:
-                       if e.errno != errno.ENOENT:
-                               raise
-                       del e
+                       try:
+                               os.unlink(os.path.join(
+                                       os.path.dirname(normalize_path(srcroot)), ".installed"))
+                       except OSError, e:
+                               if e.errno != errno.ENOENT:
+                                       raise
+                               del e
 
                otherversions=[]
                for v in self.vartree.dbapi.cp_list(self.mysplit[0]):