From da471fa9a131f3bb99941ef315f187b8772a3d7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 29 Mar 2013 10:23:47 +0100 Subject: [PATCH] Support overriding repo-name from layout.conf. Consider this an undocumented and unsupported feature which will make my life much easier. And decrease the amount of repo_name changes committed by mistake. See bug #433561. --- pym/portage/repository/config.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index adeab188d..969fce43e 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -180,6 +180,12 @@ class RepoConfig(object): # them the ability to do incremental overrides self.aliases = layout_data['aliases'] + tuple(aliases) + if layout_data['repo-name']: + # allow layout.conf to override repository name + # useful when having two copies of the same repo enabled + # to avoid modifying profiles/repo_name in one of them + self.name = layout_data['repo-name'] + for value in ('allow-missing-manifest', 'allow-provide-virtual', 'cache-formats', 'create-manifest', 'disable-manifest', 'manifest-hashes', @@ -748,6 +754,8 @@ def parse_layout_conf(repo_location, repo_name=None): data['thin-manifest'] = layout_data.get('thin-manifests', 'false').lower() \ == 'true' + data['repo-name'] = _gen_valid_repo(layout_data.get('repo-name', '')) + manifest_policy = layout_data.get('use-manifests', 'strict').lower() data['allow-missing-manifest'] = manifest_policy != 'strict' data['create-manifest'] = manifest_policy != 'false' -- 2.26.2