From: Michał Górny Date: Fri, 29 Mar 2013 09:23:47 +0000 (+0100) Subject: Support overriding repo-name from layout.conf. X-Git-Tag: v2.2.0_alpha171~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=da471fa9a131f3bb99941ef315f187b8772a3d7f;p=portage.git 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. --- 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'