Revert r6968 since shutil.move() is broken internally.
authorZac Medico <zmedico@gentoo.org>
Sat, 23 Jun 2007 13:11:08 +0000 (13:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 23 Jun 2007 13:11:08 +0000 (13:11 -0000)
svn path=/main/branches/2.1.2/; revision=6971

bin/emerge
pym/dispatch_conf.py
pym/portage.py

index 914f8d69c39452a869fbe182fd77d32065aad7c5..3d6e9e245ebf30c0e8ce040fa90a008b4420d2b0 100755 (executable)
@@ -3696,17 +3696,14 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
 
                        icount=0
                        badcount=0
-                       import shutil
                        for inforoot in regen_infodirs:
                                if inforoot=='':
                                        continue
                                for filename in ("dir", "dir.gz", "dir.bz2"):
                                        file_path = os.path.join(inforoot, filename)
-                                       if not os.path.exists(file_path):
-                                               continue
                                        try:
-                                               shutil.move(file_path, file_path + ".old")
-                                       except EnvironmentError, e:
+                                               os.rename(file_path, file_path + ".old")
+                                       except OSError, e:
                                                if e.errno != errno.ENOENT:
                                                        raise
                                                del e
index 6df0146d5d233df9ddfe2f6713dba6c74dde1d94..690772bf85a6c201b439811de7e0c3e8eaec0199 100644 (file)
@@ -7,7 +7,7 @@
 # Library by Wayne Davison <gentoo@blorf.net>, derived from code
 # written by Jeremy Wohl (http://igmus.org)
 
-from stat import ST_GID, ST_MODE, ST_UID
+from stat import *
 import os, sys, commands, shutil
 
 import portage
@@ -72,7 +72,7 @@ def rcs_archive(archive, curconf, newconf, mrgconf):
         os.system(RCS_GET + ' -r' + RCS_BRANCH + ' ' + archive)
         has_branch = os.path.exists(archive)
         if has_branch:
-            shutil.move(archive, archive + '.dist')
+            os.rename(archive, archive + '.dist')
 
         try:
             shutil.copy2(newconf, archive)
@@ -87,7 +87,7 @@ def rcs_archive(archive, curconf, newconf, mrgconf):
                 mystat = os.lstat(newconf)
                 os.chmod(mrgconf, mystat[ST_MODE])
                 os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID])
-        shutil.move(archive, archive + '.dist.new')
+        os.rename(archive, archive + '.dist.new')
     return ret
 
 
@@ -112,10 +112,10 @@ def file_archive(archive, curconf, newconf, mrgconf):
             suf += 1
 
         while suf > 1:
-            shutil.move(archive + '.' + str(suf-1), archive + '.' + str(suf))
+            os.rename(archive + '.' + str(suf-1), archive + '.' + str(suf))
             suf -= 1
 
-        shutil.move(archive, archive + '.1')
+        os.rename(archive, archive + '.1')
 
     try:
         shutil.copy2(curconf, archive)
@@ -145,7 +145,7 @@ def file_archive(archive, curconf, newconf, mrgconf):
 def rcs_archive_post_process(archive):
     """Check in the archive file with the .dist.new suffix on the branch
     and remove the one with the .dist suffix."""
-    shutil.move(archive + '.dist.new', archive)
+    os.rename(archive + '.dist.new', archive)
     if os.path.exists(archive + '.dist'):
         # Commit the last-distributed version onto the branch.
         os.system(RCS_LOCK + RCS_BRANCH + ' ' + archive)
@@ -158,4 +158,4 @@ def rcs_archive_post_process(archive):
 
 def file_archive_post_process(archive):
     """Rename the archive file with the .dist.new suffix to a .dist suffix"""
-    shutil.move(archive + '.dist.new', archive + '.dist')
+    os.rename(archive + '.dist.new', archive + '.dist')
index 1f6ef39c02d1c9c0a3d261662a8ff9bc6892eed3..d2f2cb027f0769a84ed594f33ec5016039d8a60b 100644 (file)
@@ -5264,16 +5264,16 @@ class vardbapi(dbapi):
                        if os.path.exists(newpath):
                                #dest already exists; keep this puppy where it is.
                                continue
-                       shutil.move(origpath, newpath)
+                       os.rename(origpath, newpath)
 
                        # We need to rename the ebuild now.
                        old_pf = catsplit(mycpv)[1]
                        new_pf = catsplit(mynewcpv)[1]
                        if new_pf != old_pf:
                                try:
-                                       shutil.move(os.path.join(newpath, old_pf + ".ebuild"),
+                                       os.rename(os.path.join(newpath, old_pf + ".ebuild"),
                                                os.path.join(newpath, new_pf + ".ebuild"))
-                               except EnvironmentError, e:
+                               except OSError, e:
                                        if e.errno != errno.ENOENT:
                                                raise
                                        del e
@@ -6489,7 +6489,7 @@ class binarytree(object):
                                        if e.errno != errno.EEXIST:
                                                raise
                                        del e
-                               shutil.move(tbz2path, new_path)
+                               os.rename(tbz2path, new_path)
                                self._remove_symlink(mycpv)
                                if new_path.split(os.path.sep)[-2] == "All":
                                        self._create_symlink(mynewcpv)
@@ -6587,7 +6587,7 @@ class binarytree(object):
                                if e.errno != errno.EEXIST:
                                        raise
                                del e
-                       shutil.move(src_path, os.path.join(self.pkgdir, "All", myfile))
+                       os.rename(src_path, os.path.join(self.pkgdir, "All", myfile))
                        self._create_symlink(cpv)
                self._pkg_paths[cpv] = os.path.join("All", myfile)
 
@@ -6605,7 +6605,7 @@ class binarytree(object):
                        if e.errno != errno.EEXIST:
                                raise
                        del e
-               shutil.move(os.path.join(self.pkgdir, "All", myfile), dest_path)
+               os.rename(os.path.join(self.pkgdir, "All", myfile), dest_path)
                self._pkg_paths[cpv] = mypath
 
        def populate(self, getbinpkgs=0,getbinpkgsonly=0):
@@ -7051,7 +7051,7 @@ class dblink:
                                if x[:-7] != self.pkg:
                                        # Clean up after vardbapi.move_ent() breakage in
                                        # portage versions before 2.1.2
-                                       shutil.move(os.path.join(self.dbdir, x), myebuildpath)
+                                       os.rename(os.path.join(self.dbdir, x), myebuildpath)
                                        write_atomic(os.path.join(self.dbdir, "PF"), self.pkg+"\n")
                                break