Fix unmerge-backup/preserve-libs interaction.
authorZac Medico <zmedico@gentoo.org>
Mon, 2 Jul 2012 22:27:28 +0000 (15:27 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 2 Jul 2012 22:27:28 +0000 (15:27 -0700)
pym/portage/dbapi/vartree.py

index d619754717ba5375bc5e9f51cd08f5132a2006da..289eaaeb97d0d9f55e020a4f228199d3a50a580c 100644 (file)
@@ -1832,9 +1832,6 @@ class dblink(object):
                except UnsupportedAPIException as e:
                        eapi_unsupported = e
 
-               self._prune_plib_registry(unmerge=True, needed=needed,
-                       preserve_paths=preserve_paths)
-
                builddir_lock = None
                scheduler = self._scheduler
                retval = os.EX_OK
@@ -1849,6 +1846,9 @@ class dblink(object):
                                prepare_build_dirs(settings=self.settings, cleanup=True)
                                log_path = self.settings.get("PORTAGE_LOG_FILE")
 
+                       # Do this before the following _prune_plib_registry call, since
+                       # that removes preserved libraries from our CONTENTS, and we want
+                       # may want to backup those libraries first.
                        if not caller_handles_backup:
                                retval = self._pre_unmerge_backup(background)
                                if retval != os.EX_OK:
@@ -1856,6 +1856,9 @@ class dblink(object):
                                                level=logging.ERROR, noiselevel=-1)
                                        return retval
 
+                       self._prune_plib_registry(unmerge=True, needed=needed,
+                               preserve_paths=preserve_paths)
+
                        # Log the error after PORTAGE_LOG_FILE is initialized
                        # by prepare_build_dirs above.
                        if eapi_unsupported: