unmerge: remove unused preserve-libs
authorZac Medico <zmedico@gentoo.org>
Sun, 18 Mar 2012 22:39:40 +0000 (15:39 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 18 Mar 2012 22:39:40 +0000 (15:39 -0700)
This fixes a case were one or more packages are unmerged without being
replaced, and some preserved libraries need to be removed because
they all consumers have just been unmerged.

pym/portage/dbapi/vartree.py

index 4811e60bd6720167dedb5edada6323c6faae4205..0bcc94729fb3c77fad659fc474ba8260ee917c62 100644 (file)
@@ -1966,6 +1966,15 @@ class dblink(object):
                        contents=contents, env=self.settings,
                        writemsg_level=self._display_merge, vardbapi=self.vartree.dbapi)
 
+               unmerge_with_replacement = preserve_paths is not None
+               if not unmerge_with_replacement:
+                       # When there's a replacement package which calls us via treewalk,
+                       # treewalk will automatically call _prune_plib_registry for us.
+                       # Otherwise, we need to call _prune_plib_registry ourselves.
+                       # Don't pass in the "unmerge=True" flag here, since that flag
+                       # is intended to be used _prior_ to unmerge, not after.
+                       self._prune_plib_registry()
+
                return os.EX_OK
 
        def _display_merge(self, msg, level=0, noiselevel=0):