diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-30 13:00:02 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-30 13:00:02 -0700 |
commit | d3e181fd0b841f3205dfcc2711f0bd4f5faa80e5 (patch) | |
tree | a17307177b3cefd6f1e88668ef170e774cc323ee | |
parent | f6dd8aae8eb6a34bf79a7ea017e9d4d391638025 (diff) | |
download | portage-d3e181fd0b841f3205dfcc2711f0bd4f5faa80e5.tar.gz portage-d3e181fd0b841f3205dfcc2711f0bd4f5faa80e5.tar.bz2 portage-d3e181fd0b841f3205dfcc2711f0bd4f5faa80e5.zip |
Use _ENABLE_PRESERVE_LIBS and _ENABLE_DYN_LINK_MAP constants to control
instantiation of vardbapi._plib_registry and vardbapi._linkmap.
-rw-r--r-- | pym/portage/dbapi/vartree.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index bda2d5145..9c4355143 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -33,6 +33,7 @@ portage.proxy.lazyimport.lazyimport(globals(), from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \ PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH +from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_PRESERVE_LIBS from portage.dbapi import dbapi from portage.exception import CommandNotFound, \ InvalidData, InvalidPackageName, \ @@ -139,14 +140,19 @@ class vardbapi(dbapi): self._counter_path = os.path.join(self._eroot, CACHE_PATH, "counter") - try: - 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 + if _ENABLE_PRESERVE_LIBS: + try: + 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 + pass - self._linkmap = LinkageMap(self) + self._linkmap = None + if _ENABLE_DYN_LINK_MAP: + self._linkmap = LinkageMap(self) self._owners = self._owners_db(self) def getpath(self, mykey, filename=None): |