Support aliases in metadata/layout.conf.
authorZac Medico <zmedico@gentoo.org>
Fri, 22 Oct 2010 17:41:50 +0000 (10:41 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 22 Oct 2010 17:41:50 +0000 (10:41 -0700)
This was requested by Daniel Robbins <drobbins@funtoo.org> so that
the funtoo repository can set 'aliases = gentoo' in layout.conf,
relieving funtoo users from the need to do a manual alias configuration
in /etc/portage/repos.conf.

man/portage.5
pym/portage/repository/config.py

index 80e42de75bc4a362e8de2db597fe6a73703f1e19..7fe21283c28334c54b0cceffcc0bf15614232ffa 100644 (file)
@@ -679,14 +679,15 @@ order:
 .RS
 .TP
 .BR layout.conf
-Specifies information about the repository layout. Currently, only a single
+Specifies information about the repository layout. A
 "masters" attribute is supported, which is used to specify names of
 repositories which satisfy dependencies on eclasses and/or ebuilds. Each
 repository name should correspond the value of a \fBrepo_name\fR entry
 from one of the repositories that is configured via the \fBPORTDIR\fR or
 \fBPORTDIR_OVERLAY\fR variables (see \fBmake.conf\fR(5)). Repositories listed
 toward the right of the \fBmasters\fR list take precedence over those listed
-toward the left of the list. \fISite-specific\fR
+toward the left of the list. An "aliases" attribute is also supported, which
+behaves like an "aliases" attribute in \fBrepos.conf\fR. \fISite-specific\fR
 overrides to \fBlayout.conf\fR settings may be specified in
 \fB/etc/portage/repos.conf\fR. Settings in \fBrepos.conf\fR take
 precedence over settings in \fBlayout.conf\fR, except tools such as
@@ -699,6 +700,8 @@ precedence over settings in \fBlayout.conf\fR, except tools such as
 # eclasses provided by java-overlay take precedence over identically named
 # eclasses that are provided by gentoo
 masters = gentoo java-overlay
+# indicate that this repo can be used as a substitute for foo-overlay
+aliases = foo-overlay
 .fi
 .RE
 .TP
index 36dee484af5df4140eae6f50f8fd9517d8bfa06b..1f2e48012867708a18423835f1202bcfce80b974 100644 (file)
@@ -299,6 +299,16 @@ class RepoConfigLoader(object):
                                masters = None
                        repo.masters = masters
 
+                       aliases = layout_data.get('aliases')
+                       if aliases and aliases.strip():
+                               aliases = aliases.split()
+                       else:
+                               aliases = None
+                       if aliases:
+                               if repo.aliases:
+                                       aliases.extend(repo.aliases)
+                               repo.aliases = tuple(sorted(set(aliases)))
+
                #Take aliases into account.
                new_prepos = {}
                for repo_name, repo in prepos.items():