For bug #160971, rename dir.gz to dir.gz.old when necessary to avoid problems with...
authorZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 22:23:22 +0000 (22:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 22:23:22 +0000 (22:23 -0000)
svn path=/main/trunk/; revision=5503

bin/emerge

index 3132b814c7b0251438afe238f3f9885dc1f66b12..7bb2fc5d44b3235928cbad37846caa593804c9db 100755 (executable)
@@ -3462,12 +3462,14 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
                        for inforoot in regen_infodirs:
                                if inforoot=='':
                                        continue
-                               try:
-                                       os.rename(inforoot+"/dir",inforoot+"/dir.old")
-                               except SystemExit, e:
-                                       raise # Needed else can't exit
-                               except:
-                                       pass
+                               for filename in ("dir", "dir.gz"):
+                                       file_path = os.path.join(inforoot, filename)
+                                       try:
+                                               os.rename(file_path, file_path + ".old")
+                                       except OSError, e:
+                                               if e.errno != errno.ENOENT:
+                                                       raise
+                                               del e
 
                                if not os.path.isdir(inforoot):
                                        continue