diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-03 19:33:55 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-03 19:33:55 -0700 |
commit | 7d2026628046cf3849fce81f58567e27788450d6 (patch) | |
tree | 1a08bd882f15c7bb66446819a4e5c4d20d606ee1 | |
parent | 0596519a09288ac73ce84761284cf734ef1a9867 (diff) | |
download | portage-7d2026628046cf3849fce81f58567e27788450d6.tar.gz portage-7d2026628046cf3849fce81f58567e27788450d6.tar.bz2 portage-7d2026628046cf3849fce81f58567e27788450d6.zip |
Bug #330645 - Use more lazy imports for the portage.data module, in
order to avoid circular import triggered by missing 'portage' user
or group.
-rw-r--r-- | pym/portage/dbapi/porttree.py | 2 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 2 | ||||
-rw-r--r-- | pym/portage/package/ebuild/config.py | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index a40678bdd..956d6a80a 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -8,6 +8,7 @@ __all__ = [ import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.checksum', + 'portage.data:portage_gid,secpass', 'portage.dbapi.dep_expand:dep_expand', 'portage.dep:dep_getkey,flatten,match_from_list,paren_reduce,use_reduce', 'portage.env.loaders:KeyValuePairFileLoader', @@ -20,7 +21,6 @@ portage.proxy.lazyimport.lazyimport(globals(), from portage.cache.cache_errors import CacheError from portage.cache.mappings import Mapping from portage.const import REPO_NAME_LOC -from portage.data import portage_gid, secpass from portage.dbapi import dbapi from portage.exception import PortageException, \ FileNotFound, InvalidDependString, InvalidPackageName diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index dbdb7d0b5..bda969296 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -8,6 +8,7 @@ __all__ = ["PreservedLibsRegistry", "LinkageMap", import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.checksum:_perform_md5_merge@perform_md5', + 'portage.data:portage_gid,portage_uid,secpass', 'portage.dbapi.dep_expand:dep_expand', 'portage.dep:dep_getkey,isjustname,flatten,match_from_list,' + \ 'use_reduce,paren_reduce,_slot_re', @@ -30,7 +31,6 @@ portage.proxy.lazyimport.lazyimport(globals(), from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \ PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH -from portage.data import portage_gid, portage_uid, secpass from portage.dbapi import dbapi from portage.exception import CommandNotFound, \ InvalidData, InvalidPackageName, \ diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 240b8e280..7266a6366 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -19,6 +19,9 @@ except ImportError: from ConfigParser import SafeConfigParser, ParsingError import portage +portage.proxy.lazyimport.lazyimport(globals(), + 'portage.data:portage_gid', +) from portage import bsd_chflags, eapi_is_supported, \ load_mod, os, selinux, _encodings, _unicode_encode, _unicode_decode from portage.const import CACHE_PATH, CUSTOM_PROFILE_PATH, \ @@ -26,7 +29,6 @@ from portage.const import CACHE_PATH, CUSTOM_PROFILE_PATH, \ MODULES_FILE_PATH, PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, \ PRIVATE_PATH, PROFILE_PATH, SUPPORTED_FEATURES, USER_CONFIG_PATH, \ USER_VIRTUALS_FILE -from portage.data import portage_gid from portage.dbapi import dbapi from portage.dbapi.porttree import portdbapi from portage.dbapi.vartree import vartree |