public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/
Date: Sat,  8 Oct 2011 22:52:38 +0000 (UTC)	[thread overview]
Message-ID: <c77d2dfeb2d1856d9443b64ab8d9fe95d7796cf0.zmedico@gentoo> (raw)

commit:     c77d2dfeb2d1856d9443b64ab8d9fe95d7796cf0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  8 22:51:45 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct  8 22:52:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c77d2dfe

RepoConfig: allow repos.conf 'masters' override

This give the user the power to override 'masters' settings from
layout.conf, is case they want use a different set of masters to
satisfy dependencies. This is especially important now that recursive
expansion of masters is supported since commit
ab2a6cc357ba3c8272a4a1556e2c0bcd4bee102e, so that the user can avoid
pulling in unwanted repositories as dependencies, if necessary.

Also, empty 'masters' settings are now supported, in case a repo
wants to avoid implicit inheritance of PORTDIR settings like
package.mask.

---
 man/portage.5                    |    7 +++++++
 pym/portage/repository/config.py |   26 ++++++++++++++++++--------
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index 1d9545a..860803b 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 8f7e809..1d042ac 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():



             reply	other threads:[~2011-10-08 22:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-08 22:52 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-28  6:17 [gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/ Zac Medico
2013-06-19 18:52 Zac Medico
2013-07-24  0:36 Arfrever Frehtes Taifersar Arahesis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c77d2dfeb2d1856d9443b64ab8d9fe95d7796cf0.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox