From 2f351c8a47472560c5f1bd063efc8a97ed56636f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 29 Aug 2010 23:31:47 -0700 Subject: [PATCH] Rename vardbapi.linkmap to vardbapi._linkmap since I'm trying to minimize the diff between the master branch and 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 | 2 +- pym/_emerge/clear_caches.py | 2 +- pym/_emerge/main.py | 2 +- pym/portage/dbapi/vartree.py | 18 +++++++++--------- pym/portage/sets/libs.py | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 9f184bb6b..a2cff5957 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -881,7 +881,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, # with consumers that have not been selected for removal. If so, these # packages and any dependencies need to be added to the graph. real_vardb = trees[myroot]["vartree"].dbapi - linkmap = real_vardb.linkmap + linkmap = real_vardb._linkmap consumer_cache = {} provider_cache = {} consumer_map = {} diff --git a/pym/_emerge/clear_caches.py b/pym/_emerge/clear_caches.py index 5999f281a..a0e945255 100644 --- a/pym/_emerge/clear_caches.py +++ b/pym/_emerge/clear_caches.py @@ -10,6 +10,6 @@ def clear_caches(trees): d["porttree"].dbapi._aux_cache.clear() d["bintree"].dbapi._aux_cache.clear() d["bintree"].dbapi._clear_cache() - d["vartree"].dbapi.linkmap._clear_cache() + d["vartree"].dbapi._linkmap._clear_cache() dircache.clear() gc.collect() diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 7efa35692..4b77f3b1f 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -224,7 +224,7 @@ def display_preserved_libs(vardbapi, myopts): print(colorize("WARN", "!!!") + " existing preserved libs:") plibdata = vardbapi._plib_registry.getPreservedLibs() - linkmap = vardbapi.linkmap + linkmap = vardbapi._linkmap consumer_map = {} owners = {} linkmap_broken = False diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index be2eac259..72685b5ad 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -146,7 +146,7 @@ class vardbapi(dbapi): # apparently this user isn't allowed to access PRIVATE_PATH self._plib_registry = None - self.linkmap = LinkageMap(self) + self._linkmap = LinkageMap(self) self._owners = self._owners_db(self) def getpath(self, mykey, filename=None): @@ -2160,7 +2160,7 @@ class dblink(object): def _linkmap_rebuild(self, **kwargs): """ - Rebuild the self.linkmap if it's not broken due to missing + 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. """ @@ -2169,7 +2169,7 @@ class dblink(object): not self.vartree.dbapi._plib_registry.hasEntries()): return try: - self.vartree.dbapi.linkmap.rebuild(**kwargs) + self.vartree.dbapi._linkmap.rebuild(**kwargs) except CommandNotFound as e: self._linkmap_broken = True self._display_merge(_("!!! Disabling preserve-libs " \ @@ -2187,7 +2187,7 @@ class dblink(object): return None os = _os_merge - linkmap = self.vartree.dbapi.linkmap + linkmap = self.vartree.dbapi._linkmap installed_instance = self._installed_instance old_contents = installed_instance.getcontents() root = self._eroot @@ -2369,7 +2369,7 @@ class dblink(object): path_node_map[path] = node return node - linkmap = self.vartree.dbapi.linkmap + linkmap = self.vartree.dbapi._linkmap for cpv, plibs in plib_dict.items(): for f in plibs: path_cpv_map[f] = cpv @@ -2379,7 +2379,7 @@ class dblink(object): lib_graph.add(preserved_node, None) preserved_paths.add(f) preserved_nodes.add(preserved_node) - for c in self.vartree.dbapi.linkmap.findConsumers(f): + for c in self.vartree.dbapi._linkmap.findConsumers(f): consumer_node = path_to_node(c) if not consumer_node.file_exists(): continue @@ -3238,7 +3238,7 @@ class dblink(object): dblnk._clear_contents_cache() self._clear_contents_cache() - linkmap = self.vartree.dbapi.linkmap + linkmap = self.vartree.dbapi._linkmap self._linkmap_rebuild(include_file=os.path.join(inforoot, linkmap._needed_aux_key)) @@ -3820,7 +3820,7 @@ class dblink(object): finally: self.settings.pop('REPLACING_VERSIONS', None) - self.vartree.dbapi.linkmap._clear_cache() + self.vartree.dbapi._linkmap._clear_cache() self.unlockdb() self.vartree.dbapi._bump_mtime(self.mycpv) return retval @@ -3927,7 +3927,7 @@ def unmerge(cat, pkg, myroot=None, settings=None, return retval return os.EX_OK finally: - vartree.dbapi.linkmap._clear_cache() + vartree.dbapi._linkmap._clear_cache() mylink.unlockdb() def write_contents(contents, root, f): diff --git a/pym/portage/sets/libs.py b/pym/portage/sets/libs.py index 3aeec5b7e..b20acebf0 100644 --- a/pym/portage/sets/libs.py +++ b/pym/portage/sets/libs.py @@ -42,7 +42,7 @@ class LibraryFileConsumerSet(LibraryConsumerSet): def load(self): consumers = set() for lib in self.files: - consumers.update(self.dbapi.linkmap.findConsumers(lib)) + consumers.update(self.dbapi._linkmap.findConsumers(lib)) if not consumers: return @@ -67,10 +67,10 @@ class PreservedLibraryConsumerSet(LibraryConsumerSet): for lib in libs: if self.debug: print(lib) - for x in sorted(self.dbapi.linkmap.findConsumers(lib)): + for x in sorted(self.dbapi._linkmap.findConsumers(lib)): print(" ", x) print("-"*40) - consumers.update(self.dbapi.linkmap.findConsumers(lib)) + consumers.update(self.dbapi._linkmap.findConsumers(lib)) # Don't rebuild packages just because they contain preserved # libs that happen to be consumers of other preserved libs. for libs in plib_dict.values(): -- 2.26.2