summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-04-30 07:13:29 +0000
committerZac Medico <zmedico@gentoo.org>2009-04-30 07:13:29 +0000
commitaed153868674bc3a578dae0e47cc64293e93011f (patch)
treefc5c919e15c0de5fbb4c936766e66763a36293d2
parentCall realpath(repodir) so it's conistent with the value that pordbapi uses. (diff)
downloadportage-multirepo-aed153868674bc3a578dae0e47cc64293e93011f.tar.gz
portage-multirepo-aed153868674bc3a578dae0e47cc64293e93011f.tar.bz2
portage-multirepo-aed153868674bc3a578dae0e47cc64293e93011f.zip
Add support in repos.conf to override the "masters" setting from layout.conf.
(trunk r13350) svn path=/main/branches/2.1.6/; revision=13506
-rw-r--r--man/portage.513
-rw-r--r--pym/portage/__init__.py14
-rw-r--r--pym/portage/dbapi/porttree.py27
3 files changed, 40 insertions, 14 deletions
diff --git a/man/portage.5 b/man/portage.5
index dc02a7be..a87d1984 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -551,8 +551,9 @@ x11\-libs/qt \-mysql
Specifies \fIsite\-specific\fR repository configuration information. Note that
configuration settings which are specified here do not apply to tools
such as \fBrepoman\fR(1) and \fBegencache\fR(1) since their operations
-are inherently \fBnot\fR \fIsite\-specific\fR. Beware that use of
-\fBeclass\-overrides\fR is generally not recommended and that it may trigger
+are inherently \fBnot\fR \fIsite\-specific\fR. \fBWARNING:\fR Use of
+\fBrepos.conf\fR is generally not recommended since resulting changes in
+eclass inheritance (especially due ot \fBeclass\-overrides\fR) may trigger
performance issues under some circumstances (see \fBbug #124041\fR).
.I Example:
@@ -566,6 +567,10 @@ eclass\-overrides = java\-overlay java\-experimental
# disable all eclass overrides for ebuilds from the gentoo repository
[gentoo]
eclass\-overrides =
+
+# override the metadata/layout.conf masters setting from the kde-testing repo
+[kde-testing]
+masters = gentoo kde
.fi
.RE
.TP
@@ -578,7 +583,9 @@ Specifies information about the repository layout. Currently, only a single
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)).
+\fBPORTDIR_OVERLAY\fR variables (see \fBmake.conf\fR(5)). Site-specific
+overrides to \fBlayout.conf\fR settings may be specified in
+\fB/etc/portage/repos.conf\fR.
.I Example:
.nf
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index ef9b2e6f..a0fc3655 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1001,11 +1001,19 @@ def _lazy_iuse_regex(iuse_implicit):
return regex
class _local_repo_config(object):
- __slots__ = ('eclass_overrides', 'name',)
+ __slots__ = ('eclass_overrides', 'masters', 'name',)
def __init__(self, name, repo_opts):
self.name = name
- self.eclass_overrides = \
- tuple(repo_opts.get('eclass-overrides', '').split())
+
+ eclass_overrides = repo_opts.get('eclass-overrides')
+ if eclass_overrides is not None:
+ eclass_overrides = tuple(eclass_overrides.split())
+ self.eclass_overrides = eclass_overrides
+
+ masters = repo_opts.get('masters')
+ if masters is not None:
+ masters = tuple(masters.split())
+ self.masters = masters
class config(object):
"""
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index a9496c8e..246a0d6f 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -207,11 +207,27 @@ class portdbapi(dbapi):
continue
repo_name = self._repository_map.get(path)
+
+ loc_repo_conf = None
+ if local_repo_configs is not None:
+ if repo_name is not None:
+ loc_repo_conf = local_repo_configs.get(repo_name)
+ else:
+ loc_repo_conf = default_loc_repo_config
+
layout_filename = os.path.join(path, "metadata/layout.conf")
layout_file = KeyValuePairFileLoader(layout_filename, None, None)
layout_data, layout_errors = layout_file.load()
porttrees = []
- for master_name in layout_data.get('masters', '').split():
+
+ masters = None
+ if loc_repo_conf is not None and \
+ loc_repo_conf.masters is not None:
+ masters = loc_repo_conf.masters
+ else:
+ masters = layout_data.get('masters', '').split()
+
+ for master_name in masters:
master_path = self.treemap.get(master_name)
if master_path is None:
writemsg_level(("Unavailable repository '%s' " + \
@@ -230,13 +246,8 @@ class portdbapi(dbapi):
porttrees.append(path)
- if local_repo_configs is not None:
- loc_repo_conf = None
- if repo_name is not None:
- loc_repo_conf = local_repo_configs.get(repo_name)
- if loc_repo_conf is None:
- loc_repo_conf = default_loc_repo_config
- if loc_repo_conf is not None:
+ if loc_repo_conf is not None and \
+ loc_repo_conf.eclass_overrides is not None:
for other_name in loc_repo_conf.eclass_overrides:
other_path = self.treemap.get(other_name)
if other_path is None: