summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/portage.57
-rw-r--r--pym/portage/repository/config.py26
2 files changed, 25 insertions, 8 deletions
diff --git a/man/portage.5 b/man/portage.5
index 1d9545ab6..860803b4c 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -714,6 +714,13 @@ aliases = foo bar
[kde-testing]
# override the metadata/layout.conf masters setting from the kde-testing repo
masters = gentoo kde
+
+[python]
+# override the metadata/layout.conf masters setting from the python repo,
+# so that settings won't be inherited from those masters, and so that
+# those master repos won't be required as dependencies (the user must
+# ensure that any required dependencies such as eclasses are satisfied)
+masters =
.fi
.RE
.TP
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 8f7e80969..1d042ac0e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -66,8 +66,11 @@ class RepoConfig(object):
#Locations are computed later.
self.eclass_locations = None
- #Masters are only read from layout.conf.
- self.masters = None
+ # Masters from repos.conf override layout.conf.
+ masters = repo_opts.get('masters')
+ if masters is not None:
+ masters = tuple(masters.split())
+ self.masters = masters
#The main-repo key makes only sense for the 'DEFAULT' section.
self.main_repo = repo_opts.get('main-repo')
@@ -358,12 +361,19 @@ class RepoConfigLoader(object):
layout_file = KeyValuePairFileLoader(layout_filename, None, None)
layout_data, layout_errors = layout_file.load()
- masters = layout_data.get('masters')
- if masters and masters.strip():
- masters = masters.split()
- else:
- masters = None
- repo.masters = masters
+ # Only set masters here if is None, so that repos.conf settings
+ # will override those from layout.conf. This gives the
+ # user control over inherited repositories and their settings
+ # (the user must ensure that any required dependencies such as
+ # eclasses are satisfied).
+ if repo.masters is None:
+ masters = layout_data.get('masters')
+ if masters is not None:
+ # We support empty masters settings here, in case a
+ # repo wants to avoid implicit inheritance of PORTDIR
+ # settings like package.mask.
+ masters = tuple(masters.split())
+ repo.masters = masters
aliases = layout_data.get('aliases')
if aliases and aliases.strip():