From: Zac Medico Date: Wed, 4 Aug 2010 02:33:55 +0000 (-0700) Subject: Bug #330645 - Use more lazy imports for the portage.data module, in X-Git-Tag: v2.2_rc68~417 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7d2026628046cf3849fce81f58567e27788450d6;p=portage.git Bug #330645 - Use more lazy imports for the portage.data module, in order to avoid circular import triggered by missing 'portage' user or group. --- 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