From 445f0d70d3624bc108b08da6d370bf194fcfc4ac Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 29 Aug 2010 23:49:32 -0700 Subject: Always check if vardbapi._linkmap and vardbapi._plib_registry are None before trying to use them. This will be useful in the upcoming 2.1.9 branch which will not have preserve-libs support but will still have the code in private and disabled form. --- pym/_emerge/actions.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pym/_emerge/actions.py') diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index a2cff5957..99b2a469e 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -447,7 +447,13 @@ def action_build(settings, trees, mtimedb, portage.writemsg_stdout(colorize("WARN", "WARNING:") + " AUTOCLEAN is disabled. This can cause serious" + " problems due to overlapping packages.\n") - trees[settings["ROOT"]]["vartree"].dbapi._plib_registry.pruneNonExisting() + plib_registry = \ + trees[settings["ROOT"]]["vartree"].dbapi._plib_registry + if plib_registry is None: + # preserve-libs is entirely disabled + pass + else: + plib_registry.pruneNonExisting() return retval @@ -875,7 +881,9 @@ def calc_depclean(settings, trees, ldpath_mtimes, cleanlist = create_cleanlist() clean_set = set(cleanlist) - if cleanlist and myopts.get('--depclean-lib-check') != 'n': + if cleanlist and \ + real_vardb._linkmap is not None and \ + myopts.get('--depclean-lib-check') != 'n': # Check if any of these package are the sole providers of libraries # with consumers that have not been selected for removal. If so, these -- cgit v1.2.3-1-g7c22