For bug #158558, make the unmerge phase do automatic cleanup for broken vardbapi...
authorZac Medico <zmedico@gentoo.org>
Tue, 19 Dec 2006 23:30:14 +0000 (23:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 19 Dec 2006 23:30:14 +0000 (23:30 -0000)
svn path=/main/trunk/; revision=5328

pym/portage.py

index fb8690bac052266fb61fd613d37fb9ad5c1bdcab..d0f2bbe5f4c8fdfc40efb1ab98d692182b6b5a39 100644 (file)
@@ -6347,7 +6347,12 @@ class dblink:
                mystuff = listdir(self.dbdir, EmptyOnError=1)
                for x in mystuff:
                        if x.endswith(".ebuild"):
-                               myebuildpath = os.path.join(self.dbdir, x)
+                               myebuildpath = os.path.join(self.dbdir, self.pkg + ".ebuild")
+                               if x[:-7] != self.pkg:
+                                       # Clean up after vardbapi.move_ent() breakage in
+                                       # portage versions before 2.1.2
+                                       os.rename(os.path.join(self.dbdir, x), myebuildpath)
+                                       write_atomic(os.path.join(self.dbdir, "PF"), self.pkg+"\n")
                                break
 
                self.settings.load_infodir(self.dbdir)