Make the collision-protect loop check for existance of the destination file before...
authorZac Medico <zmedico@gentoo.org>
Fri, 15 Jun 2007 22:39:58 +0000 (22:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 15 Jun 2007 22:39:58 +0000 (22:39 -0000)
svn path=/main/trunk/; revision=6858

pym/portage/dbapi/vartree.py

index 5e397f099543b221c2df629731ebd856f6b6d5dd..5affc5f07144df188c5fb21ac53111be653327fa 100644 (file)
@@ -1415,6 +1415,15 @@ class dblink(object):
                                i = i + 1
                                if i % 1000 == 0:
                                        print str(i)+" files checked ..."
+                               dest_path = normalize_path(
+                                       os.path.join(destroot, f.lstrip(os.path.sep)))
+                               try:
+                                       dest_lstat = os.lstat(dest_path)
+                               except EnvironmentError, e:
+                                       if e.errno != errno.ENOENT:
+                                               raise
+                                       del e
+                                       continue
                                if f[0] != "/":
                                        f="/"+f
                                isowned = False