parse_layout_conf: fix profile-formats warning
authorZac Medico <zmedico@gentoo.org>
Thu, 27 Oct 2011 17:10:53 +0000 (10:10 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 27 Oct 2011 17:10:53 +0000 (10:10 -0700)
pym/portage/repository/config.py
pym/portage/tests/ebuild/test_config.py

index 07969ccb4cce513ec51db5bf287958f9ff32b2aa..9bffd709734b788f8bccae2573ed40cc518ddb55 100644 (file)
@@ -676,11 +676,13 @@ def parse_layout_conf(repo_location, repo_name=None):
        else:
                raw_formats = set(raw_formats.split())
                unknown = raw_formats.difference(['pms', 'portage-1'])
-               warnings.warn((_("Repository named '%(repo_name)s' has unsupported "
-                       "profiles in use ('profile-format' setting in '%(layout_filename)s;"
-                       " please upgrade portage.") %
-                       dict(repo_name=repo_name, layout_filename=layout_filename)),
-                       DeprecationWarning)
+               if unknown:
+                       warnings.warn((_("Repository named '%(repo_name)s' has unsupported "
+                               "profiles in use ('profile-format = %(unknown_fmts)s' setting in "
+                               "'%(layout_filename)s; please upgrade portage.") %
+                               dict(repo_name=repo_name, layout_filename=layout_filename,
+                               unknown_fmts=" ".join(unknown))),
+                               DeprecationWarning)
                raw_formats = tuple(raw_formats.intersection(['pms', 'portage-1']))
        data['profile-formats'] = raw_formats
 
index ea641925e05c07beb73edb6b90cc98a7e48acd7d..570cb2bc94d8eb56912543c8fe52cc608c54515c 100644 (file)
@@ -217,6 +217,7 @@ class ConfigTestCase(TestCase):
                        "new_repo": {
                                "layout.conf":
                                        (
+                                               "profile-formats = pms",
                                                "thin-manifests = true",
                                                "manifest-hashes = RMD160 SHA1 SHA256 SHA512 WHIRLPOOL",
                                        ),