diff options
author | Tim Harder <radhermit@gmail.com> | 2015-07-05 01:53:27 -0400 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2015-07-05 02:19:23 -0400 |
commit | 56f0e67996a0d501ef062788334a7c08543737bf (patch) | |
tree | ab450f715cb2b1648de80f545334e0f8078a4834 | |
parent | repo: fix initial sync for new repos using repos.conf names (diff) | |
download | pkgcore-56f0e67996a0d501ef062788334a7c08543737bf.tar.gz pkgcore-56f0e67996a0d501ef062788334a7c08543737bf.tar.bz2 pkgcore-56f0e67996a0d501ef062788334a7c08543737bf.zip |
portage_conf: remove extra repo config object creation for cache init
This still should be fixed to be done lazily on access so we're not
creating duplicate, throw away repo config objs per repo.
-rw-r--r-- | pkgcore/ebuild/portage_conf.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/pkgcore/ebuild/portage_conf.py b/pkgcore/ebuild/portage_conf.py index 07c57dd4..d13eae07 100644 --- a/pkgcore/ebuild/portage_conf.py +++ b/pkgcore/ebuild/portage_conf.py @@ -225,15 +225,11 @@ def add_fetcher(config, make_conf): config["fetcher"] = basics.AutoConfigSection(fetcher_dict) -def make_cache(repo_path): - # TODO: probably should pull RepoConfig objects dynamically from the config - # instead of regenerating them - repo_config = RepoConfig(repo_path) - - # Use md5 cache if it exists or the option is selected, otherwise default to - # the old flat hash format in /var/cache/edb/dep/*. +def make_cache(cache_format, repo_path): + # Use md5 cache if it exists or the option is selected, otherwise default + # to the old flat hash format in /var/cache/edb/dep/*. if (os.path.exists(pjoin(repo_path, 'metadata', 'md5-cache')) or - repo_config.cache_format == 'md5-dict'): + cache_format == 'md5-dict'): kls = 'pkgcore.cache.flat_hash.md5_cache' cache_parent_dir = pjoin(repo_path, 'metadata', 'md5-cache') else: @@ -458,7 +454,7 @@ def config_from_make_conf(location=None, profile_override=None, **kwargs): # metadata cache cache_name = 'cache:' + repo_path - config[cache_name] = make_cache(repo_path) + config[cache_name] = make_cache(repo_config.cache_format, repo_path) # repo trees kwds = { |