summaryrefslogtreecommitdiffstats
path: root/pym/portage/repository/config.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-09-07 21:32:03 -0700
committerZac Medico <zmedico@gentoo.org>2012-09-07 21:32:03 -0700
commit24b7ebe3b9404f0344f5b34eb322abde64143263 (patch)
tree2c5744e66faa0a1b16819695fd22a6a4f01a3a37 /pym/portage/repository/config.py
parentc35ec6c074f44ffbf7849c54976c91ce5a53e8fe (diff)
downloadportage-24b7ebe3b9404f0344f5b34eb322abde64143263.tar.gz
portage-24b7ebe3b9404f0344f5b34eb322abde64143263.tar.bz2
portage-24b7ebe3b9404f0344f5b34eb322abde64143263.zip
Detect md5-cache when no cache-formats specified.
Auto-detect cache-formats from the corresponding directories when cache-formats is not specifed in layout.conf, and prefer md5-dict if available. After this behavior is deployed in stable portage, the default egencache format can be changed to md5-dict.
Diffstat (limited to 'pym/portage/repository/config.py')
-rw-r--r--pym/portage/repository/config.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 9b43f3872..4de49f0ce 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -713,9 +713,15 @@ def parse_layout_conf(repo_location, repo_name=None):
# for compatibility w/ PMS, fallback to pms; but also check if the
# cache exists or not.
cache_formats = layout_data.get('cache-formats', '').lower().split()
- if not cache_formats and os.path.isdir(
- os.path.join(repo_location, 'metadata', 'cache')):
- cache_formats = ['pms']
+ if not cache_formats:
+ # Auto-detect cache formats, and prefer md5-cache if available.
+ # After this behavior is deployed in stable portage, the default
+ # egencache format can be changed to md5-dict.
+ cache_formats = []
+ if os.path.isdir(os.path.join(repo_location, 'metadata', 'md5-cache')):
+ cache_formats.append('md5-dict')
+ if os.path.isdir(os.path.join(repo_location, 'metadata', 'cache')):
+ cache_formats.append('pms')
data['cache-formats'] = tuple(cache_formats)
manifest_hashes = layout_data.get('manifest-hashes')