diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-17 23:27:46 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-17 23:27:46 -0700 |
commit | 0c14f511444b74e4e19b4aed7af910cc8cfae8a5 (patch) | |
tree | e5619a67e698802d72d608efb8d775a4189e9b0c /pym/portage | |
parent | cb3f4b3c7a81ea5f15f9e5dbc67ede961511d2f8 (diff) | |
download | portage-0c14f511444b74e4e19b4aed7af910cc8cfae8a5.tar.gz portage-0c14f511444b74e4e19b4aed7af910cc8cfae8a5.tar.bz2 portage-0c14f511444b74e4e19b4aed7af910cc8cfae8a5.zip |
load_best_module: tweak metadata_overlay fallback
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/package/ebuild/config.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 2739584c5..542cfaca5 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -126,6 +126,11 @@ class config(object): 'PROPERTIES', 'PROVIDE', 'RDEPEND', 'SLOT', 'repository', 'RESTRICT', 'LICENSE',) + _module_aliases = { + "cache.metadata_overlay.database" : "portage.cache.flat_hash.database", + "portage.cache.metadata_overlay.database" : "portage.cache.flat_hash.database", + } + _case_insensitive_vars = special_env_vars.case_insensitive_vars _default_globals = special_env_vars.default_globals _env_blacklist = special_env_vars.env_blacklist @@ -880,18 +885,16 @@ class config(object): try: mod = load_mod(best_mod) except ImportError: - if not best_mod.startswith("cache."): + if best_mod in self._module_aliases: + mod = load_mod(self._module_aliases[best_mod]) + elif not best_mod.startswith("cache."): raise else: best_mod = "portage." + best_mod try: mod = load_mod(best_mod) except ImportError: - if best_mod == "portage.cache.metadata_overlay.database": - best_mod = "portage.cache.flat_hash.database" - mod = load_mod(best_mod) - else: - raise + raise return mod def lock(self): |