From 03c4ecb1f49415b886d52bcaad773c9853343b55 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 27 Oct 2011 10:10:53 -0700 Subject: [PATCH] parse_layout_conf: fix profile-formats warning --- pym/portage/repository/config.py | 12 +++++++----- pym/portage/tests/ebuild/test_config.py | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 07969ccb4..9bffd7097 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -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 diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py index ea641925e..570cb2bc9 100644 --- a/pym/portage/tests/ebuild/test_config.py +++ b/pym/portage/tests/ebuild/test_config.py @@ -217,6 +217,7 @@ class ConfigTestCase(TestCase): "new_repo": { "layout.conf": ( + "profile-formats = pms", "thin-manifests = true", "manifest-hashes = RMD160 SHA1 SHA256 SHA512 WHIRLPOOL", ), -- 2.26.2