Bug #330645 - Use more lazy imports for the portage.data module, in
authorZac Medico <zmedico@gentoo.org>
Wed, 4 Aug 2010 02:33:55 +0000 (19:33 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 4 Aug 2010 02:33:55 +0000 (19:33 -0700)
order to avoid circular import triggered by missing 'portage' user
or group.

pym/portage/dbapi/porttree.py
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/config.py

index a40678bdd085f91783fd2214cb0ed379a2c94f5f..956d6a80a8f114ebfdf335bcf25d9c32f153a954 100644 (file)
@@ -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
index dbdb7d0b59056d781e7d6f67a99fe7c66a2c527f..bda9692961b6c8684b1a077d00ef269e39b6815f 100644 (file)
@@ -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, \
index 240b8e280191ab086e1346dbe80a4f4b46e4bc63..7266a63661013b788356cc412b70d8deaab7e83b 100644 (file)
@@ -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