From 1824d5744ffcfa25bb92c40e2498dd0d3fc5989c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 20 Aug 2010 09:41:21 -0700 Subject: * Make dblink._linkmap_rebuild() return early if preserve-libs is disabled and the preserve-libs registry is empty. * Make dblink._find_unused_preserved_libs() return early if the preserve-libs registry is empty. --- pym/portage/dbapi/vartree.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 688f4c52a..b72cba024 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -2870,7 +2870,14 @@ class dblink(object): return False def _linkmap_rebuild(self, **kwargs): - if self._linkmap_broken: + """ + Rebuild the self.linkmap if it's not broken due to missing + scanelf binary. Also, return early if preserve-libs is disabled + and the preserve-libs registry is empty. + """ + if self._linkmap_broken or \ + ("preserve-libs" not in self.settings.features and \ + not self.vartree.dbapi.plib_registry.hasEntries()): return try: self.vartree.dbapi.linkmap.rebuild(**kwargs) @@ -3048,7 +3055,8 @@ class dblink(object): Find preserved libraries that don't have any consumers left. """ - if self._linkmap_broken: + if self._linkmap_broken or \ + not self.vartree.dbapi.plib_registry.hasEntries(): return {} # Since preserved libraries can be consumers of other preserved -- cgit v1.2.3-1-g7c22