parse_layout_conf: fix cache-formats pms fallback
authorZac Medico <zmedico@gentoo.org>
Wed, 6 Jun 2012 00:11:00 +0000 (17:11 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 6 Jun 2012 00:11:00 +0000 (17:11 -0700)
This fixes an issue where egencache would not generate metadata/cache
unless the directory already existed.

pym/portage/repository/config.py

index 20f191948a07f81bb74560f6e2936979a8260863..9b43f387284569e637a50943c79831155b287d49 100644 (file)
@@ -712,10 +712,10 @@ 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', 'pms').lower().split()
-       if 'pms' in cache_formats and not os.path.isdir(
+       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.remove('pms')
+               cache_formats = ['pms']
        data['cache-formats'] = tuple(cache_formats)
 
        manifest_hashes = layout_data.get('manifest-hashes')