Rename vardbapi.plib_registry to vardbapi._plib_registry since I'm
authorZac Medico <zmedico@gentoo.org>
Mon, 30 Aug 2010 05:36:22 +0000 (22:36 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 30 Aug 2010 05:36:22 +0000 (22:36 -0700)
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.

bin/portageq
pym/_emerge/actions.py
pym/_emerge/main.py
pym/portage/dbapi/vartree.py
pym/portage/sets/libs.py
pym/portage/util/_dyn_libs/LinkageMapELF.py

index e27ce482919f942e3a3b93accac422131410f102..2a7807c1599cc7444b09106baf658db92bbad8db 100755 (executable)
@@ -557,7 +557,7 @@ def list_preserved_libs(argv):
        if len(argv) != 1:
                print("ERROR: wrong number of arguments")
                sys.exit(2)
-       mylibs = portage.db[argv[0]]["vartree"].dbapi.plib_registry.getPreservedLibs()
+       mylibs = portage.db[argv[0]]["vartree"].dbapi._plib_registry.getPreservedLibs()
        rValue = 0
        msg = []
        for cpv in sorted(mylibs):
index 815032d14f7d9c9913318a14eca385831f1d8a8a..9f184bb6be82ab56278e3787c80bd16527103aca 100644 (file)
@@ -447,7 +447,7 @@ 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()
+                       trees[settings["ROOT"]]["vartree"].dbapi._plib_registry.pruneNonExisting()
 
                return retval
 
index 81a86874801500f2b88fa098e3a075d7e99cddae..7efa35692a1bbb79ecd9cd35a72c2b2b98870d79 100644 (file)
@@ -212,9 +212,9 @@ def display_preserved_libs(vardbapi, myopts):
        MAX_DISPLAY = 3
 
        # Ensure the registry is consistent with existing files.
-       vardbapi.plib_registry.pruneNonExisting()
+       vardbapi._plib_registry.pruneNonExisting()
 
-       if vardbapi.plib_registry.hasEntries():
+       if vardbapi._plib_registry.hasEntries():
                if "--quiet" in myopts:
                        print()
                        print(colorize("WARN", "!!!") + " existing preserved libs found")
@@ -223,7 +223,7 @@ def display_preserved_libs(vardbapi, myopts):
                        print()
                        print(colorize("WARN", "!!!") + " existing preserved libs:")
 
-               plibdata = vardbapi.plib_registry.getPreservedLibs()
+               plibdata = vardbapi._plib_registry.getPreservedLibs()
                linkmap = vardbapi.linkmap
                consumer_map = {}
                owners = {}
index 48b0bc09fe3d91fc4a2bb41c1a0cb6c3890f4e67..be2eac259050374f34179da1fb79d32c30f84f5d 100644 (file)
@@ -140,11 +140,11 @@ class vardbapi(dbapi):
                        CACHE_PATH, "counter")
 
                try:
-                       self.plib_registry = PreservedLibsRegistry(self._eroot,
+                       self._plib_registry = PreservedLibsRegistry(self._eroot,
                                os.path.join(self._eroot, PRIVATE_PATH, "preserved_libs_registry"))
                except PermissionDenied:
                        # apparently this user isn't allowed to access PRIVATE_PATH
-                       self.plib_registry = None
+                       self._plib_registry = None
 
                self.linkmap = LinkageMap(self)
                self._owners = self._owners_db(self)
@@ -1525,7 +1525,7 @@ class dblink(object):
                        self._clear_contents_cache()
 
                        # Remove the registration of preserved libs for this pkg instance
-                       plib_registry = self.vartree.dbapi.plib_registry
+                       plib_registry = self.vartree.dbapi._plib_registry
                        plib_registry.unregister(self.mycpv, self.settings["SLOT"],
                                self.vartree.dbapi.cpv_counter(self.mycpv))
 
@@ -1567,7 +1567,7 @@ class dblink(object):
                        else:
                                # Prune any preserved libs that may have
                                # been unmerged with this package.
-                               self.vartree.dbapi.plib_registry.pruneNonExisting()
+                               self.vartree.dbapi._plib_registry.pruneNonExisting()
 
                finally:
                        self.vartree.dbapi._bump_mtime(self.mycpv)
@@ -2166,7 +2166,7 @@ class dblink(object):
                """
                if self._linkmap_broken or \
                        ("preserve-libs" not in self.settings.features and \
-                       not self.vartree.dbapi.plib_registry.hasEntries()):
+                       not self.vartree.dbapi._plib_registry.hasEntries()):
                        return
                try:
                        self.vartree.dbapi.linkmap.rebuild(**kwargs)
@@ -2345,12 +2345,12 @@ class dblink(object):
                """
 
                if self._linkmap_broken or \
-                       not self.vartree.dbapi.plib_registry.hasEntries():
+                       not self.vartree.dbapi._plib_registry.hasEntries():
                        return {}
 
                # Since preserved libraries can be consumers of other preserved
                # libraries, use a graph to track consumer relationships.
-               plib_dict = self.vartree.dbapi.plib_registry.getPreservedLibs()
+               plib_dict = self.vartree.dbapi._plib_registry.getPreservedLibs()
                lib_graph = digraph()
                preserved_nodes = set()
                preserved_paths = set()
@@ -2488,7 +2488,7 @@ class dblink(object):
                                if x == prev:
                                        break
 
-               self.vartree.dbapi.plib_registry.pruneNonExisting()
+               self.vartree.dbapi._plib_registry.pruneNonExisting()
 
        def _collision_protect(self, srcroot, destroot, mypkglist, mycontents):
 
@@ -2500,7 +2500,7 @@ class dblink(object):
 
                        # For collisions with preserved libraries, the current package
                        # will assume ownership and the libraries will be unregistered.
-                       plib_dict = self.vartree.dbapi.plib_registry.getPreservedLibs()
+                       plib_dict = self.vartree.dbapi._plib_registry.getPreservedLibs()
                        plib_cpv_map = {}
                        plib_paths = set()
                        for cpv, paths in plib_dict.items():
@@ -3304,7 +3304,7 @@ class dblink(object):
 
                # keep track of the libs we preserved
                if preserve_paths:
-                       self.vartree.dbapi.plib_registry.register(self.mycpv,
+                       self.vartree.dbapi._plib_registry.register(self.mycpv,
                                slot, counter, sorted(preserve_paths))
 
                # Check for file collisions with blocking packages
@@ -3319,7 +3319,7 @@ class dblink(object):
 
                # Unregister any preserved libs that this package has overwritten
                # and update the contents of the packages that owned them.
-               plib_registry = self.vartree.dbapi.plib_registry
+               plib_registry = self.vartree.dbapi._plib_registry
                plib_dict = plib_registry.getPreservedLibs()
                for cpv, paths in plib_collisions.items():
                        if cpv not in plib_dict:
@@ -3773,8 +3773,8 @@ class dblink(object):
                self.lockdb()
                self.vartree.dbapi._bump_mtime(self.mycpv)
                try:
-                       self.vartree.dbapi.plib_registry.load()
-                       self.vartree.dbapi.plib_registry.pruneNonExisting()
+                       self.vartree.dbapi._plib_registry.load()
+                       self.vartree.dbapi._plib_registry.pruneNonExisting()
                        retval = self.treewalk(mergeroot, myroot, inforoot, myebuild,
                                cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes)
 
@@ -3919,8 +3919,8 @@ def unmerge(cat, pkg, myroot=None, settings=None,
        try:
                mylink.lockdb()
                if mylink.exists():
-                       vartree.dbapi.plib_registry.load()
-                       vartree.dbapi.plib_registry.pruneNonExisting()
+                       vartree.dbapi._plib_registry.load()
+                       vartree.dbapi._plib_registry.pruneNonExisting()
                        retval = mylink.unmerge(ldpath_mtimes=ldpath_mtimes)
                        if retval == os.EX_OK:
                                mylink.delete()
index 624e70bf68feb45867822d58ad3c3f2a920a6f6c..3aeec5b7e4780fb38ab46f1cd8cb4678f953f6cd 100644 (file)
@@ -59,7 +59,7 @@ class LibraryFileConsumerSet(LibraryConsumerSet):
 
 class PreservedLibraryConsumerSet(LibraryConsumerSet):
        def load(self):
-               reg = self.dbapi.plib_registry
+               reg = self.dbapi._plib_registry
                consumers = set()
                if reg:
                        plib_dict = reg.getPreservedLibs()
index a159f7a59ec7bd2c9fbd0b2fb30d22d52654f82b..8993d93f7c02ab415184cd95d9cbf2f790dbf5ac 100644 (file)
@@ -174,9 +174,9 @@ class LinkageMapELF(object):
                # have to call scanelf for preserved libs here as they aren't 
                # registered in NEEDED.ELF.2 files
                plibs = set()
-               if self._dbapi.plib_registry and self._dbapi.plib_registry.getPreservedLibs():
+               if self._dbapi._plib_registry and self._dbapi._plib_registry.getPreservedLibs():
                        args = ["/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
-                       for items in self._dbapi.plib_registry.getPreservedLibs().values():
+                       for items in self._dbapi._plib_registry.getPreservedLibs().values():
                                plibs.update(items)
                                args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
                                        for x in items)