Make dblink.unmerge() succeed even when ebuild phases are unsuccessful because
authorZac Medico <zmedico@gentoo.org>
Mon, 4 Aug 2008 01:11:07 +0000 (01:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 4 Aug 2008 01:11:07 +0000 (01:11 -0000)
the current behavior is even worse (results in orphan files). Thanks to
Arfrever for this patch (UnsupportedAPIException hunk by me).

svn path=/main/trunk/; revision=11323

pym/portage/dbapi/vartree.py

index c8babe5463693aab99c2a68eaae38396cac4d1c6..8d40c24be958255c0398d3e3ea744f2bd68e6827 100644 (file)
@@ -1607,10 +1607,12 @@ class dblink(object):
                                writemsg("!!! FAILED prerm: %s\n" % \
                                        os.path.join(self.dbdir, "EAPI"), noiselevel=-1)
                                writemsg("%s\n" % str(e), noiselevel=-1)
-                               return 1
-                       catdir = os.path.dirname(self.settings["PORTAGE_BUILDDIR"])
-                       ensure_dirs(os.path.dirname(catdir),
-                               uid=portage_uid, gid=portage_gid, mode=070, mask=0)
+                               myebuildpath = None
+                       else:
+                               catdir = os.path.dirname(self.settings["PORTAGE_BUILDDIR"])
+                               ensure_dirs(os.path.dirname(catdir), uid=portage_uid,
+                                       gid=portage_gid, mode=070, mask=0)
+
                builddir_lock = None
                catdir_lock = None
                scheduler = self._scheduler
@@ -1643,7 +1645,6 @@ class dblink(object):
                                # XXX: Decide how to handle failures here.
                                if retval != os.EX_OK:
                                        writemsg("!!! FAILED prerm: %s\n" % retval, noiselevel=-1)
-                                       return retval
 
                        self._unmerge_pkgfiles(pkgfiles, others_in_slot)
                        
@@ -1665,7 +1666,6 @@ class dblink(object):
                                # XXX: Decide how to handle failures here.
                                if retval != os.EX_OK:
                                        writemsg("!!! FAILED postrm: %s\n" % retval, noiselevel=-1)
-                                       return retval
 
                        # regenerate reverse NEEDED map
                        self.vartree.dbapi.linkmap.rebuild()