public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, ...
@ 2012-09-12  7:29 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2012-09-12  7:29 UTC (permalink / raw
  To: gentoo-commits

commit:     96b053ac52fa37fdd61cbb76cb44dfb90fb49f86
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 12 07:28:51 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 12 07:28:51 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=96b053ac

Prefer /etc/portage/make.profile.

This is the default location used by current versions of eselect
profile, and will soon be the default location in stages. Since
eselect profile generates a warning if both /etc/make.profile and
/etc/portage/make.profile exist, the new default should be fairly
safe (although eselect profile currently prefers /etc/make.profile
when both exist).

---
 cnf/make.conf                                      |    2 +-
 man/emerge.1                                       |    6 +++---
 man/make.conf.5                                    |    4 ++--
 man/portage.5                                      |   20 ++++++++++----------
 pym/_emerge/Scheduler.py                           |    5 +++--
 pym/portage/const.py                               |    2 +-
 .../package/ebuild/_config/LocationsManager.py     |    2 +-
 pym/portage/package/ebuild/config.py               |    2 +-
 8 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/cnf/make.conf b/cnf/make.conf
index 7dcfbb9..7a6bff5 100644
--- a/cnf/make.conf
+++ b/cnf/make.conf
@@ -92,7 +92,7 @@
 #
 # PORTDIR is the location of the portage tree. This is the repository
 #     for all profile information as well as all ebuilds. If you change
-#     this, you must update your /etc/make.profile symlink accordingly.
+#     this, you must update your /etc/portage/make.profile symlink accordingly.
 #     ***Warning***
 #     Data stored inside PORTDIR is in peril of being overwritten or deleted by
 #     the emerge --sync command. The default value of PORTAGE_RSYNC_OPTS

diff --git a/man/emerge.1 b/man/emerge.1
index 6793490..a25c573 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1083,7 +1083,7 @@ Contains user package set definitions (see \fBportage\fR(5)).
 Contains settings to handle automatic updates/backups of configuration 
 files.
 .TP
-.B /etc/make.profile/make.defaults
+.B /etc/portage/make.profile/make.defaults
 Contains profile\-specific variables for the build process.  \fBDo not
 edit this file\fR.
 .TP
@@ -1091,11 +1091,11 @@ edit this file\fR.
 Contains the master list of USE flags with descriptions of their
 functions.  \fBDo not edit this file\fR.
 .TP
-.B /etc/make.profile/virtuals
+.B /etc/portage/make.profile/virtuals
 Contains a list of default packages used to resolve virtual dependencies.
 \fBDo not edit this file\fR.
 .TP
-.B /etc/make.profile/packages
+.B /etc/portage/make.profile/packages
 Contains a list of packages used for the base system.  The \fBsystem\fR
 and \fBworld\fR sets consult this file.  \fBDo not edit this file\fR.
 .TP

diff --git a/man/make.conf.5 b/man/make.conf.5
index d9babe1..e2a16a5 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -13,7 +13,7 @@ Portage then checks the make.conf files. Both /etc/make.conf and
 If no setting is found in the make.conf files, Portage checks
 make.globals. If no
 setting is found there, the profile's default setting is grabbed
-from /etc/make.profile/make.defaults. Please note that all user
+from /etc/portage/make.profile/make.defaults. Please note that all user
 settings should be made in the environment or in the make.conf
 files, which are intended to be customized by the user.
 .br
@@ -855,7 +855,7 @@ This variable controls permissions for \fIWORKDIR\fR (see \fBebuild\fR(5)).
 \fBPORTDIR\fR = \fI[path]\fR
 Defines the location of the Portage tree. This is the repository for all
 profile information as well as all ebuilds. If you change this, you must update
-your /etc/make.profile symlink accordingly.
+your /etc/portage/make.profile symlink accordingly.
 .br
 Defaults to /usr/portage. 
 .br

diff --git a/man/portage.5 b/man/portage.5
index fc36ddb..49f8dcd 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -20,7 +20,7 @@ If you are looking for information on how to emerge something, please see
 .BR make.conf (5)
 .fi
 .TP
-\fB/etc/make.profile/\fR or \fB/etc/portage/make.profile/\fR
+\fB/etc/portage/make.profile/\fR or \fB/etc/make.profile/\fR
 site\-specific overrides go in \fB/etc/portage/profile/\fR
 .nf
 deprecated
@@ -67,7 +67,7 @@ repos.conf
 package-specific bashrc files
 .TP
 .BR /etc/portage/profile/
-site-specific overrides of \fB/etc/make.profile/\fR
+site-specific overrides of \fB/etc/portage/make.profile/\fR
 .TP
 .BR /etc/portage/sets/
 user\-defined package sets
@@ -201,18 +201,18 @@ More reading:
 The global custom settings for Portage.  See \fBmake.conf\fR(5).
 .RE
 .TP
-\fB/etc/make.profile/\fR or \fB/etc/portage/make.profile/\fR
+\fB/etc/portage/make.profile/\fR or \fB/etc/make.profile/\fR
 This is usually just a symlink to the correct profile in 
 \fB/usr/portage/profiles/\fR.  Since it is part of the portage tree, it 
 may easily be updated/regenerated by running `emerge \-\-sync`.  It defines 
 what a profile is (usually arch specific stuff).  If you need a custom 
-profile, then you should make your own \fB/etc/make.profile/\fR 
+profile, then you should make your own \fBmake.profile\fR 
 directory and populate it.  However, if you just wish to override some 
 settings, use \fB/etc/portage/profile/\fR (it supports all of the same file
-types that \fB/etc/make.profile/\fR does, except parent). Do NOT edit the
-settings in \fB/etc/make.profile/\fR because they WILL be lost with the next
-`emerge \-\-sync`. If both \fB/etc/make.profile/\fR and
-\fB/etc/portage/make.profile/\fR exist, then \fB/etc/make.profile/\fR
+types that \fBmake.profile\fR does, except parent). Do NOT edit the
+settings in \fBmake.profile\fR because they WILL be lost with the next
+`emerge \-\-sync`. If both \fB/etc/portage/make.profile/\fR and
+\fB/etc/make.profile/\fR exist, then \fB/etc/portage/make.profile/\fR
 will be preferred.
 
 Any file in this directory, directories of other profiles or top-level
@@ -239,8 +239,8 @@ explaining how they can upgrade.
 .nf
 default-linux/x86/2005.0
 # emerge -n '>=sys-apps/portage-2.0.51'
-# rm -f /etc/make.profile
-# ln -s /usr/portage/profiles/default-linux/alpha/2005.0 /etc/make.profile
+# rm -f /etc/portage/make.profile
+# ln -s /usr/portage/profiles/default-linux/alpha/2005.0 /etc/portage/make.profile
 .fi
 .TP
 .BR eapi

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 9f1c86e..795f503 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -653,10 +653,11 @@ class Scheduler(PollScheduler):
 				if value and value.strip():
 					continue
 				msg = _("%(var)s is not set... "
-					"Are you missing the '%(configroot)setc/make.profile' symlink? "
+					"Are you missing the '%(configroot)s%(profile_path)s' symlink? "
 					"Is the symlink correct? "
 					"Is your portage tree complete?") % \
-					{"var": var, "configroot": settings["PORTAGE_CONFIGROOT"]}
+					{"var": var, "configroot": settings["PORTAGE_CONFIGROOT"],
+					"profile_path": portage.const.PROFILE_PATH}
 
 				out = portage.output.EOutput()
 				for line in textwrap.wrap(msg, 70):

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 3b8e350..1ebfdc8 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -36,7 +36,7 @@ EBUILD_SH_ENV_FILE       = USER_CONFIG_PATH + "/bashrc"
 EBUILD_SH_ENV_DIR        = USER_CONFIG_PATH + "/env"
 CUSTOM_MIRRORS_FILE      = USER_CONFIG_PATH + "/mirrors"
 COLOR_MAP_FILE           = USER_CONFIG_PATH + "/color.map"
-PROFILE_PATH             = "etc/make.profile"
+PROFILE_PATH             = USER_CONFIG_PATH + "/make.profile"
 MAKE_DEFAULTS_FILE       = PROFILE_PATH + "/make.defaults"  # FIXME: not used
 DEPRECATED_PROFILE_FILE  = PROFILE_PATH + "/deprecated"
 

diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym/portage/package/ebuild/_config/LocationsManager.py
index f7a1177..365d507 100644
--- a/pym/portage/package/ebuild/_config/LocationsManager.py
+++ b/pym/portage/package/ebuild/_config/LocationsManager.py
@@ -78,7 +78,7 @@ class LocationsManager(object):
 				self.profile_path = self.config_profile_path
 			else:
 				self.config_profile_path = \
-					os.path.join(self.abs_user_config, 'make.profile')
+					os.path.join(self.config_root, 'etc', 'make.profile')
 				if os.path.isdir(self.config_profile_path):
 					self.profile_path = self.config_profile_path
 				else:

diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 8f3b59b..ffebd22 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -958,7 +958,7 @@ class config(object):
 
 		if profile_broken:
 			abs_profile_path = None
-			for x in (PROFILE_PATH, 'etc/portage/make.profile'):
+			for x in (PROFILE_PATH, 'etc/make.profile'):
 				x = os.path.join(self["PORTAGE_CONFIGROOT"], x)
 				try:
 					os.lstat(x)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, ...
@ 2014-01-18 11:36 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 4+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-01-18 11:36 UTC (permalink / raw
  To: gentoo-commits

commit:     4c409a049c394389b1de398db511380e2fed0437
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Jan 18 11:33:01 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sat Jan 18 11:33:01 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4c409a04

Add support for the following attributes in layout.conf to allow more
precise configuration of inheritance of settings from repositories:
  eclass-masters
  package.mask-masters
  use.aliases-masters
  use.force-masters
  use.mask-masters

---
 man/portage.5                                     |  76 +++++++++++--
 pym/portage/package/ebuild/_config/MaskManager.py |  10 +-
 pym/portage/package/ebuild/_config/UseManager.py  |  23 ++--
 pym/portage/package/ebuild/getmaskingreason.py    |   8 +-
 pym/portage/repository/config.py                  | 130 ++++++++++++----------
 5 files changed, 166 insertions(+), 81 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index 0aac569..5090529 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -800,7 +800,9 @@ since operations performed by these tools are inherently
 Specifies names of attributes, which should be forcefully respected by
 \fBegencache\fR(1), \fBemirrordist\fR(1) and \fBrepoman\fR(1).
 .br
-Valid values: aliases, eclass\-overrides, masters
+Valid values: aliases, eclass\-masters, eclass\-overrides, masters,
+package.mask\-masters, use.aliases\-masters, use.force\-masters,
+use.mask\-masters
 .RE
 
 .I Attributes supported in sections of repositories:
@@ -834,21 +836,24 @@ since operations performed by these tools are inherently
 Specifies names of attributes, which should be forcefully respected by
 \fBegencache\fR(1), \fBemirrordist\fR(1) and \fBrepoman\fR(1).
 .br
-Valid values: aliases, eclass\-overrides, masters
+Valid values: aliases, eclass\-masters, eclass\-overrides, masters,
+package.mask\-masters, use.aliases\-masters, use.force\-masters,
+use.mask\-masters
 .TP
 .B location
 Specifies location of given repository.
 .TP
-.B masters
-Specifies master repositories of given repository.
+.B masters, eclass\-masters, package.mask\-masters, use.aliases\-masters, use.force\-masters, use.mask\-masters
+Specifies master repositories of given repository. See documentation of
+\fBlayout.conf\fR file for more details.
 .br
-Setting this attribute is generally not recommended since resulting changes
+Setting these attribute is generally not recommended since resulting changes
 in eclass inheritance may trigger performance issues due to invalidation
 of metadata cache.
 .br
-When 'force = masters' attribute is not set, \fBegencache\fR(1),
-\fBemirrordist\fR(1) and \fBrepoman\fR(1) ignore this attribute,
-since operations performed by these tools are inherently
+When 'force = ${attribute}' (e.g. 'force = masters') attribute is not set,
+\fBegencache\fR(1), \fBemirrordist\fR(1) and \fBrepoman\fR(1) ignore given
+attribute, since operations performed by these tools are inherently
 \fBnot\fR \fIsite\-specific\fR.
 .TP
 .B priority
@@ -986,9 +991,10 @@ Specifies information about the repository layout.
 \fB/etc/portage/repos.conf\fR.
 Settings in \fBrepos.conf\fR take precedence over settings in
 \fBlayout.conf\fR, except tools such as \fBrepoman\fR(1) and \fBegencache\fR(1)
-ignore "aliases", "eclass-overrides" and "masters" attributes set in
-\fBrepos.conf\fR since their operations are inherently \fBnot\fR
-\fIsite\-specific\fR.
+ignore "aliases", "eclass\-masters", "eclass\-overrides", "masters",
+"package.mask\-masters", "use.aliases\-masters", "use.force\-masters" and
+"use.mask\-masters" attributes set in \fBrepos.conf\fR since their operations
+are inherently \fBnot\fR \fIsite\-specific\fR.
 
 .I Format:
 .nf
@@ -996,7 +1002,7 @@ ignore "aliases", "eclass-overrides" and "masters" attributes set in
 \- attributes are specified in "${attribute} = ${value}" format
 .fi
 
-.I Supported attributes.
+.I Supported attributes:
 .RS
 .RS
 .TP
@@ -1009,6 +1015,14 @@ List of EAPIs which are not allowed in this repo.
 .BR eapis\-deprecated
 List of EAPIs which are allowed but generate warnings when used.
 .TP
+.BR eclass\-masters
+Names of repositories wherefrom eclasses can be inherited.
+.br
+This attribute overrides \fBmasters\fR attribute and should be used only when
+there is a need to set this attribute to a different value than value of
+\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
+details.
+.TP
 .BR masters
 Names of repositories which satisfy dependencies on eclasses and from which
 settings specified in various repository\-level files (\fBpackage.mask\fR,
@@ -1018,6 +1032,15 @@ the repositories that is configured in \fBrepos.conf\fR file. Repositories
 listed toward the right of the \fBmasters\fR list take precedence over those
 listed toward the left of the list.
 .TP
+.BR package.mask-masters
+Names of repositories wherefrom settings specified in repository\-level
+\fBpackage.mask\fR files are inherited.
+.br
+This attribute overrides \fBmasters\fR attribute and should be used only when
+there is a need to set this attribute to a different value than value of
+\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
+details.
+.TP
 .BR repo\-name " = <value of profiles/repo_name>"
 The name of this repository (overrides profiles/repo_name if it exists).
 .TP
@@ -1030,6 +1053,35 @@ Boolean value whether we should sign Manifest files in this repo.
 .BR thin\-manifests " = [true|" false "]"
 Boolean value whether Manifest files contain only DIST entries.
 .TP
+.BR use.aliases\-masters
+Names of repositories wherefrom settings specified in repository\-level
+\fBpackage.use.aliases\fR and \fBuse.aliases\fR files are inherited.
+.br
+This attribute overrides \fBmasters\fR attribute and should be used only when
+there is a need to set this attribute to a different value than value of
+\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
+details.
+.TP
+.BR use.force\-masters
+Names of repositories wherefrom settings specified in repository\-level
+\fBpackage.use.force\fR, \fBpackage.use.stable.force\fR, \fBuse.force\fR and
+\fBuse.stable.force\fR files are inherited.
+.br
+This attribute overrides \fBmasters\fR attribute and should be used only when
+there is a need to set this attribute to a different value than value of
+\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
+details.
+.TP
+.BR use.mask\-masters
+Names of repositories wherefrom settings specified in repository\-level
+\fBpackage.use.mask\fR, \fBpackage.use.stable.mask\fR, \fuse.mask\fR and
+\fBuse.stable.mask\fR files are inherited.
+.br
+This attribute overrides \fBmasters\fR attribute and should be used only when
+there is a need to set this attribute to a different value than value of
+\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
+details.
+.TP
 .BR use\-manifests " = [" strict "|true|false]"
 How Manifest files get used.  Possible values are "strict" (require an entry
 for every file), "true" (if an entry exists for a file, enforce it), or "false"

diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py
index aeb04d7..4358b63 100644
--- a/pym/portage/package/ebuild/_config/MaskManager.py
+++ b/pym/portage/package/ebuild/_config/MaskManager.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (
@@ -58,7 +58,11 @@ class MaskManager(object):
 			removals = frozenset(line[0][1:] for line in repo_lines
 				if line[0][:1] == "-")
 			matched_removals = set()
-			for master in repo.masters:
+			if repo.package_mask_masters is not None:
+				masters = repo.package_mask_masters
+			else:
+				masters = repo.masters
+			for master in masters:
 				master_lines = grab_pmask(master.location, master)
 				for line in master_lines:
 					if line[0] in removals:
@@ -75,7 +79,7 @@ class MaskManager(object):
 			# It's safe to warn for unmatched removal if masters have not
 			# been overridden by the user, which is guaranteed when
 			# user_config is false (when called by repoman).
-			if repo.masters:
+			if masters:
 				unmatched_removals = removals.difference(matched_removals)
 				if unmatched_removals and not user_config:
 					source_file = os.path.join(repo.location,

diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py
index 0d00810..a65e5bd 100644
--- a/pym/portage/package/ebuild/_config/UseManager.py
+++ b/pym/portage/package/ebuild/_config/UseManager.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (
@@ -312,8 +312,11 @@ class UseManager(object):
 		if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
 			repos = []
 			try:
-				repos.extend(repo.name for repo in
-					self.repositories[pkg.repo].masters)
+				if self.repositories[pkg.repo].use_mask_masters is not None:
+					masters = self.repositories[pkg.repo].use_mask_masters
+				else:
+					masters = self.repositories[pkg.repo].masters
+				repos.extend(repo.name for repo in masters)
 			except KeyError:
 				pass
 			repos.append(pkg.repo)
@@ -372,8 +375,11 @@ class UseManager(object):
 		if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
 			repos = []
 			try:
-				repos.extend(repo.name for repo in
-					self.repositories[pkg.repo].masters)
+				if self.repositories[pkg.repo].use_force_masters is not None:
+					masters = self.repositories[pkg.repo].use_force_masters
+				else:
+					masters = self.repositories[pkg.repo].masters
+				repos.extend(repo.name for repo in masters)
 			except KeyError:
 				pass
 			repos.append(pkg.repo)
@@ -428,8 +434,11 @@ class UseManager(object):
 		if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
 			repos = []
 			try:
-				repos.extend(repo.name for repo in
-					self.repositories[pkg.repo].masters)
+				if self.repositories[pkg.repo].use_aliases_masters is not None:
+					masters = self.repositories[pkg.repo].use_aliases_masters
+				else:
+					masters = self.repositories[pkg.repo].masters
+				repos.extend(repo.name for repo in masters)
 			except KeyError:
 				pass
 			repos.append(pkg.repo)

diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py
index 70a6bf2..673b40a 100644
--- a/pym/portage/package/ebuild/getmaskingreason.py
+++ b/pym/portage/package/ebuild/getmaskingreason.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = ['getmaskingreason']
@@ -70,7 +70,11 @@ def getmaskingreason(mycpv, metadata=None, settings=None,
 
 	locations = []
 	if pkg.repo in settings.repositories:
-		for repo in settings.repositories[pkg.repo].masters + (settings.repositories[pkg.repo],):
+		if settings.repositories[pkg.repo].package_mask_masters is not None:
+			masters = settings.repositories[pkg.repo].package_mask_masters
+		else:
+			masters = settings.repositories[pkg.repo].masters
+		for repo in masters + (settings.repositories[pkg.repo],):
 			locations.append(os.path.join(repo.location, "profiles"))
 	locations.extend(settings.profiles)
 	locations.append(os.path.join(settings["PORTAGE_CONFIGROOT"],

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 71b75fb..b7ee34f 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -44,6 +44,9 @@ _valid_profile_formats = frozenset(
 _portage1_profiles_allow_directories = frozenset(
 	["portage-1-compat", "portage-1", 'portage-2'])
 
+_masters_attributes = dict((x, x.replace("-", "_").replace(".", "_")) for x in
+	("masters", "eclass-masters", "package.mask-masters", "use.aliases-masters", "use.force-masters", "use.mask-masters"))
+
 _repo_name_sub_re = re.compile(r'[^\w-]')
 
 def _gen_valid_repo(name):
@@ -80,11 +83,12 @@ class RepoConfig(object):
 		'cache_formats', 'create_manifest', 'disable_manifest', 'eapi',
 		'eclass_db', 'eclass_locations', 'eclass_overrides',
 		'find_invalid_path_char', 'force', 'format', 'local_config', 'location',
-		'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
+		'main_repo', 'manifest_hashes', 'missing_repo_name',
 		'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
 		'profile_formats', 'sign_commit', 'sign_manifest', 'sync_cvs_repo',
 		'sync_type', 'sync_uri', 'thin_manifest', 'update_changelog',
-		'user_location', '_eapis_banned', '_eapis_deprecated', '_masters_orig')
+		'user_location', '_eapis_banned', '_eapis_deprecated', '_masters_orig') + \
+		tuple(_masters_attributes.values())
 
 	def __init__(self, name, repo_opts, local_config=True):
 		"""Build a RepoConfig with options in repo_opts
@@ -106,7 +110,6 @@ class RepoConfig(object):
 				aliases = tuple(aliases.split())
 		else:
 			aliases = None
-
 		self.aliases = aliases
 
 		if local_config or 'eclass-overrides' in force:
@@ -115,21 +118,21 @@ class RepoConfig(object):
 				eclass_overrides = tuple(eclass_overrides.split())
 		else:
 			eclass_overrides = None
-
 		self.eclass_overrides = eclass_overrides
+
 		# Eclass databases and locations are computed later.
 		self.eclass_db = None
 		self.eclass_locations = None
 
-		if local_config or 'masters' in force:
-			# Masters from repos.conf override layout.conf.
-			masters = repo_opts.get('masters')
-			if masters is not None:
-				masters = tuple(masters.split())
-		else:
-			masters = None
-
-		self.masters = masters
+		for attr, underscorized_attr in _masters_attributes.items():
+			if local_config or attr in force:
+				# Masters from repos.conf override layout.conf.
+				masters = repo_opts.get(attr)
+				if masters is not None:
+					masters = tuple(masters.split())
+			else:
+				masters = None
+			setattr(self, underscorized_attr, masters)
 
 		#The main-repo key makes only sense for the 'DEFAULT' section.
 		self.main_repo = repo_opts.get('main-repo')
@@ -216,8 +219,9 @@ class RepoConfig(object):
 
 			# layout.conf masters may be overridden here if we have a masters
 			# setting from the user's repos.conf
-			if self.masters is None:
-				self.masters = layout_data['masters']
+			for attr, underscorized_attr in _masters_attributes.items():
+				if getattr(self, underscorized_attr) is None:
+					setattr(self, underscorized_attr, layout_data[attr])
 
 			if (local_config or 'aliases' in force) and layout_data['aliases']:
 				aliases = self.aliases
@@ -370,8 +374,10 @@ class RepoConfig(object):
 			repo_msg.append(indent + "sync-type: " + self.sync_type)
 		if self.sync_uri:
 			repo_msg.append(indent + "sync-uri: " + self.sync_uri)
-		if self.masters:
-			repo_msg.append(indent + "masters: " + " ".join(master.name for master in self.masters))
+		for attr, underscorized_attr in _masters_attributes.items():
+			masters = getattr(self, underscorized_attr)
+			if masters:
+				repo_msg.append(indent + attr + ": " + " ".join(master.name for master in masters))
 		if self.priority is not None:
 			repo_msg.append(indent + "priority: " + str(self.priority))
 		if self.aliases:
@@ -743,36 +749,43 @@ class RepoConfigLoader(object):
 		for repo_name, repo in prepos.items():
 			if repo_name == "DEFAULT":
 				continue
-			if repo.masters is None:
-				if self.mainRepo() and repo_name != self.mainRepo().name:
-					repo.masters = self.mainRepo(),
+			for attr, underscorized_attr in _masters_attributes.items():
+				masters = getattr(repo, underscorized_attr)
+				if masters is None:
+					if attr == 'masters':
+						if self.mainRepo() and repo_name != self.mainRepo().name:
+							setattr(repo, underscorized_attr, (self.mainRepo(),))
+						else:
+							setattr(repo, underscorized_attr, ())
 				else:
-					repo.masters = ()
-			else:
-				if repo.masters and isinstance(repo.masters[0], RepoConfig):
-					# This one has already been processed
-					# because it has an alias.
-					continue
-				master_repos = []
-				for master_name in repo.masters:
-					if master_name not in prepos:
-						layout_filename = os.path.join(repo.user_location,
-							"metadata", "layout.conf")
-						writemsg_level(_("Unavailable repository '%s' " \
-							"referenced by masters entry in '%s'\n") % \
-							(master_name, layout_filename),
-							level=logging.ERROR, noiselevel=-1)
-					else:
-						master_repos.append(prepos[master_name])
-				repo.masters = tuple(master_repos)
+					if masters and isinstance(masters[0], RepoConfig):
+						# This one has already been processed
+						# because it has an alias.
+						continue
+					master_repos = []
+					for master_name in masters:
+						if master_name not in prepos:
+							layout_filename = os.path.join(repo.user_location,
+								"metadata", "layout.conf")
+							writemsg_level(_("Unavailable repository '%s' " \
+								"referenced by %s attribute in '%s'\n") % \
+								(master_name, attr, layout_filename),
+								level=logging.ERROR, noiselevel=-1)
+						else:
+							master_repos.append(prepos[master_name])
+					setattr(repo, underscorized_attr, tuple(master_repos))
 
 		#The 'eclass_overrides' key currently contains repo names. Replace them with the matching repo paths.
 		for repo_name, repo in prepos.items():
 			if repo_name == "DEFAULT":
 				continue
 
+			if repo.eclass_masters is not None:
+				masters = repo.eclass_masters
+			else:
+				masters = repo.masters
 			eclass_locations = []
-			eclass_locations.extend(master_repo.location for master_repo in repo.masters)
+			eclass_locations.extend(master_repo.location for master_repo in masters)
 			# Only append the current repo to eclass_locations if it's not
 			# there already. This allows masters to have more control over
 			# eclass override order, which may be useful for scenarios in
@@ -921,23 +934,24 @@ class RepoConfigLoader(object):
 		return repo_name in self.prepos
 
 	def config_string(self):
-		str_or_int_keys = ("format", "location", "main_repo", "priority", "sync_cvs_repo", "sync_type", "sync_uri")
-		str_tuple_keys = ("aliases", "eclass_overrides", "force")
-		repo_config_tuple_keys = ("masters",)
-		keys = str_or_int_keys + str_tuple_keys + repo_config_tuple_keys
+		str_or_int_attrs = ("format", "location", "main-repo", "priority", "sync-cvs-repo", "sync-type", "sync-uri")
+		str_tuple_attrs = ("aliases", "eclass-overrides", "force")
+		repo_config_tuple_attrs = tuple(_masters_attributes.keys())
+		attrs = str_or_int_attrs + str_tuple_attrs + repo_config_tuple_attrs
 		config_string = ""
 		for repo_name, repo in sorted(self.prepos.items()):
 			config_string += "\n[%s]\n" % repo_name
-			for key in sorted(keys):
-				if key == "main_repo" and repo_name != "DEFAULT":
+			for attr in sorted(attrs):
+				underscorized_attr = attr.replace("-", "_").replace(".", "_")
+				if attr == "main-repo" and repo_name != "DEFAULT":
 					continue
-				if getattr(repo, key) is not None:
-					if key in str_or_int_keys:
-						config_string += "%s = %s\n" % (key.replace("_", "-"), getattr(repo, key))
-					elif key in str_tuple_keys:
-						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(getattr(repo, key)))
-					elif key in repo_config_tuple_keys:
-						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(x.name for x in getattr(repo, key)))
+				if getattr(repo, underscorized_attr) is not None:
+					if attr in str_or_int_attrs:
+						config_string += "%s = %s\n" % (attr, getattr(repo, underscorized_attr))
+					elif attr in str_tuple_attrs:
+						config_string += "%s = %s\n" % (attr, " ".join(getattr(repo, underscorized_attr)))
+					elif attr in repo_config_tuple_attrs:
+						config_string += "%s = %s\n" % (attr, " ".join(x.name for x in getattr(repo, underscorized_attr)))
 		return config_string.lstrip("\n")
 
 def load_repository_config(settings, extra_files=None):
@@ -971,15 +985,17 @@ def parse_layout_conf(repo_location, repo_name=None):
 
 	data = {}
 
-	# None indicates abscence of a masters setting, which later code uses
+	# None indicates absence of a masters setting, which later code uses
 	# to trigger a backward compatibility fallback that sets an implicit
 	# master. In order to avoid this fallback behavior, layout.conf can
 	# explicitly set masters to an empty value, which will result in an
 	# empty tuple here instead of None.
-	masters = layout_data.get('masters')
-	if masters is not None:
-		masters = tuple(masters.split())
-	data['masters'] = masters
+	for attr in _masters_attributes.keys():
+		masters = layout_data.get(attr)
+		if masters is not None:
+			masters = tuple(masters.split())
+		data[attr] = masters
+
 	data['aliases'] = tuple(layout_data.get('aliases', '').split())
 
 	data['allow-provide-virtual'] = \


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, ...
@ 2014-02-09 22:40 Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2014-02-09 22:40 UTC (permalink / raw
  To: gentoo-commits

commit:     26971672ca3b79d512ad3a88027486a8053b7e17
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  9 22:35:09 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Feb  9 22:35:09 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=26971672

Revert "Add support for the following attributes in layout.conf to allow more"

This reverts commit 4c409a049c394389b1de398db511380e2fed0437.
This needs to be submitted for review and approval.

---
 man/portage.5                                     |  76 ++-----------
 pym/portage/package/ebuild/_config/MaskManager.py |  10 +-
 pym/portage/package/ebuild/_config/UseManager.py  |  23 ++--
 pym/portage/package/ebuild/getmaskingreason.py    |   8 +-
 pym/portage/repository/config.py                  | 130 ++++++++++------------
 5 files changed, 81 insertions(+), 166 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index 5090529..0aac569 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -800,9 +800,7 @@ since operations performed by these tools are inherently
 Specifies names of attributes, which should be forcefully respected by
 \fBegencache\fR(1), \fBemirrordist\fR(1) and \fBrepoman\fR(1).
 .br
-Valid values: aliases, eclass\-masters, eclass\-overrides, masters,
-package.mask\-masters, use.aliases\-masters, use.force\-masters,
-use.mask\-masters
+Valid values: aliases, eclass\-overrides, masters
 .RE
 
 .I Attributes supported in sections of repositories:
@@ -836,24 +834,21 @@ since operations performed by these tools are inherently
 Specifies names of attributes, which should be forcefully respected by
 \fBegencache\fR(1), \fBemirrordist\fR(1) and \fBrepoman\fR(1).
 .br
-Valid values: aliases, eclass\-masters, eclass\-overrides, masters,
-package.mask\-masters, use.aliases\-masters, use.force\-masters,
-use.mask\-masters
+Valid values: aliases, eclass\-overrides, masters
 .TP
 .B location
 Specifies location of given repository.
 .TP
-.B masters, eclass\-masters, package.mask\-masters, use.aliases\-masters, use.force\-masters, use.mask\-masters
-Specifies master repositories of given repository. See documentation of
-\fBlayout.conf\fR file for more details.
+.B masters
+Specifies master repositories of given repository.
 .br
-Setting these attribute is generally not recommended since resulting changes
+Setting this attribute is generally not recommended since resulting changes
 in eclass inheritance may trigger performance issues due to invalidation
 of metadata cache.
 .br
-When 'force = ${attribute}' (e.g. 'force = masters') attribute is not set,
-\fBegencache\fR(1), \fBemirrordist\fR(1) and \fBrepoman\fR(1) ignore given
-attribute, since operations performed by these tools are inherently
+When 'force = masters' attribute is not set, \fBegencache\fR(1),
+\fBemirrordist\fR(1) and \fBrepoman\fR(1) ignore this attribute,
+since operations performed by these tools are inherently
 \fBnot\fR \fIsite\-specific\fR.
 .TP
 .B priority
@@ -991,10 +986,9 @@ Specifies information about the repository layout.
 \fB/etc/portage/repos.conf\fR.
 Settings in \fBrepos.conf\fR take precedence over settings in
 \fBlayout.conf\fR, except tools such as \fBrepoman\fR(1) and \fBegencache\fR(1)
-ignore "aliases", "eclass\-masters", "eclass\-overrides", "masters",
-"package.mask\-masters", "use.aliases\-masters", "use.force\-masters" and
-"use.mask\-masters" attributes set in \fBrepos.conf\fR since their operations
-are inherently \fBnot\fR \fIsite\-specific\fR.
+ignore "aliases", "eclass-overrides" and "masters" attributes set in
+\fBrepos.conf\fR since their operations are inherently \fBnot\fR
+\fIsite\-specific\fR.
 
 .I Format:
 .nf
@@ -1002,7 +996,7 @@ are inherently \fBnot\fR \fIsite\-specific\fR.
 \- attributes are specified in "${attribute} = ${value}" format
 .fi
 
-.I Supported attributes:
+.I Supported attributes.
 .RS
 .RS
 .TP
@@ -1015,14 +1009,6 @@ List of EAPIs which are not allowed in this repo.
 .BR eapis\-deprecated
 List of EAPIs which are allowed but generate warnings when used.
 .TP
-.BR eclass\-masters
-Names of repositories wherefrom eclasses can be inherited.
-.br
-This attribute overrides \fBmasters\fR attribute and should be used only when
-there is a need to set this attribute to a different value than value of
-\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
-details.
-.TP
 .BR masters
 Names of repositories which satisfy dependencies on eclasses and from which
 settings specified in various repository\-level files (\fBpackage.mask\fR,
@@ -1032,15 +1018,6 @@ the repositories that is configured in \fBrepos.conf\fR file. Repositories
 listed toward the right of the \fBmasters\fR list take precedence over those
 listed toward the left of the list.
 .TP
-.BR package.mask-masters
-Names of repositories wherefrom settings specified in repository\-level
-\fBpackage.mask\fR files are inherited.
-.br
-This attribute overrides \fBmasters\fR attribute and should be used only when
-there is a need to set this attribute to a different value than value of
-\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
-details.
-.TP
 .BR repo\-name " = <value of profiles/repo_name>"
 The name of this repository (overrides profiles/repo_name if it exists).
 .TP
@@ -1053,35 +1030,6 @@ Boolean value whether we should sign Manifest files in this repo.
 .BR thin\-manifests " = [true|" false "]"
 Boolean value whether Manifest files contain only DIST entries.
 .TP
-.BR use.aliases\-masters
-Names of repositories wherefrom settings specified in repository\-level
-\fBpackage.use.aliases\fR and \fBuse.aliases\fR files are inherited.
-.br
-This attribute overrides \fBmasters\fR attribute and should be used only when
-there is a need to set this attribute to a different value than value of
-\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
-details.
-.TP
-.BR use.force\-masters
-Names of repositories wherefrom settings specified in repository\-level
-\fBpackage.use.force\fR, \fBpackage.use.stable.force\fR, \fBuse.force\fR and
-\fBuse.stable.force\fR files are inherited.
-.br
-This attribute overrides \fBmasters\fR attribute and should be used only when
-there is a need to set this attribute to a different value than value of
-\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
-details.
-.TP
-.BR use.mask\-masters
-Names of repositories wherefrom settings specified in repository\-level
-\fBpackage.use.mask\fR, \fBpackage.use.stable.mask\fR, \fuse.mask\fR and
-\fBuse.stable.mask\fR files are inherited.
-.br
-This attribute overrides \fBmasters\fR attribute and should be used only when
-there is a need to set this attribute to a different value than value of
-\fBmasters\fR attribute. See documentation of \fBmasters\fR attribute for more
-details.
-.TP
 .BR use\-manifests " = [" strict "|true|false]"
 How Manifest files get used.  Possible values are "strict" (require an entry
 for every file), "true" (if an entry exists for a file, enforce it), or "false"

diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py
index 4358b63..aeb04d7 100644
--- a/pym/portage/package/ebuild/_config/MaskManager.py
+++ b/pym/portage/package/ebuild/_config/MaskManager.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (
@@ -58,11 +58,7 @@ class MaskManager(object):
 			removals = frozenset(line[0][1:] for line in repo_lines
 				if line[0][:1] == "-")
 			matched_removals = set()
-			if repo.package_mask_masters is not None:
-				masters = repo.package_mask_masters
-			else:
-				masters = repo.masters
-			for master in masters:
+			for master in repo.masters:
 				master_lines = grab_pmask(master.location, master)
 				for line in master_lines:
 					if line[0] in removals:
@@ -79,7 +75,7 @@ class MaskManager(object):
 			# It's safe to warn for unmatched removal if masters have not
 			# been overridden by the user, which is guaranteed when
 			# user_config is false (when called by repoman).
-			if masters:
+			if repo.masters:
 				unmatched_removals = removals.difference(matched_removals)
 				if unmatched_removals and not user_config:
 					source_file = os.path.join(repo.location,

diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py
index a65e5bd..0d00810 100644
--- a/pym/portage/package/ebuild/_config/UseManager.py
+++ b/pym/portage/package/ebuild/_config/UseManager.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (
@@ -312,11 +312,8 @@ class UseManager(object):
 		if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
 			repos = []
 			try:
-				if self.repositories[pkg.repo].use_mask_masters is not None:
-					masters = self.repositories[pkg.repo].use_mask_masters
-				else:
-					masters = self.repositories[pkg.repo].masters
-				repos.extend(repo.name for repo in masters)
+				repos.extend(repo.name for repo in
+					self.repositories[pkg.repo].masters)
 			except KeyError:
 				pass
 			repos.append(pkg.repo)
@@ -375,11 +372,8 @@ class UseManager(object):
 		if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
 			repos = []
 			try:
-				if self.repositories[pkg.repo].use_force_masters is not None:
-					masters = self.repositories[pkg.repo].use_force_masters
-				else:
-					masters = self.repositories[pkg.repo].masters
-				repos.extend(repo.name for repo in masters)
+				repos.extend(repo.name for repo in
+					self.repositories[pkg.repo].masters)
 			except KeyError:
 				pass
 			repos.append(pkg.repo)
@@ -434,11 +428,8 @@ class UseManager(object):
 		if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
 			repos = []
 			try:
-				if self.repositories[pkg.repo].use_aliases_masters is not None:
-					masters = self.repositories[pkg.repo].use_aliases_masters
-				else:
-					masters = self.repositories[pkg.repo].masters
-				repos.extend(repo.name for repo in masters)
+				repos.extend(repo.name for repo in
+					self.repositories[pkg.repo].masters)
 			except KeyError:
 				pass
 			repos.append(pkg.repo)

diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py
index 673b40a..70a6bf2 100644
--- a/pym/portage/package/ebuild/getmaskingreason.py
+++ b/pym/portage/package/ebuild/getmaskingreason.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = ['getmaskingreason']
@@ -70,11 +70,7 @@ def getmaskingreason(mycpv, metadata=None, settings=None,
 
 	locations = []
 	if pkg.repo in settings.repositories:
-		if settings.repositories[pkg.repo].package_mask_masters is not None:
-			masters = settings.repositories[pkg.repo].package_mask_masters
-		else:
-			masters = settings.repositories[pkg.repo].masters
-		for repo in masters + (settings.repositories[pkg.repo],):
+		for repo in settings.repositories[pkg.repo].masters + (settings.repositories[pkg.repo],):
 			locations.append(os.path.join(repo.location, "profiles"))
 	locations.extend(settings.profiles)
 	locations.append(os.path.join(settings["PORTAGE_CONFIGROOT"],

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 952912e..5e0d055 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -45,9 +45,6 @@ _valid_profile_formats = frozenset(
 _portage1_profiles_allow_directories = frozenset(
 	["portage-1-compat", "portage-1", 'portage-2'])
 
-_masters_attributes = dict((x, x.replace("-", "_").replace(".", "_")) for x in
-	("masters", "eclass-masters", "package.mask-masters", "use.aliases-masters", "use.force-masters", "use.mask-masters"))
-
 _repo_name_sub_re = re.compile(r'[^\w-]')
 
 def _gen_valid_repo(name):
@@ -84,12 +81,11 @@ class RepoConfig(object):
 		'cache_formats', 'create_manifest', 'disable_manifest', 'eapi',
 		'eclass_db', 'eclass_locations', 'eclass_overrides',
 		'find_invalid_path_char', 'force', 'format', 'local_config', 'location',
-		'main_repo', 'manifest_hashes', 'missing_repo_name',
+		'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
 		'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
 		'profile_formats', 'sign_commit', 'sign_manifest', 'sync_cvs_repo',
 		'sync_type', 'sync_uri', 'thin_manifest', 'update_changelog',
-		'user_location', '_eapis_banned', '_eapis_deprecated', '_masters_orig') + \
-		tuple(_masters_attributes.values())
+		'user_location', '_eapis_banned', '_eapis_deprecated', '_masters_orig')
 
 	def __init__(self, name, repo_opts, local_config=True):
 		"""Build a RepoConfig with options in repo_opts
@@ -111,6 +107,7 @@ class RepoConfig(object):
 				aliases = tuple(aliases.split())
 		else:
 			aliases = None
+
 		self.aliases = aliases
 
 		if local_config or 'eclass-overrides' in force:
@@ -119,21 +116,21 @@ class RepoConfig(object):
 				eclass_overrides = tuple(eclass_overrides.split())
 		else:
 			eclass_overrides = None
-		self.eclass_overrides = eclass_overrides
 
+		self.eclass_overrides = eclass_overrides
 		# Eclass databases and locations are computed later.
 		self.eclass_db = None
 		self.eclass_locations = None
 
-		for attr, underscorized_attr in _masters_attributes.items():
-			if local_config or attr in force:
-				# Masters from repos.conf override layout.conf.
-				masters = repo_opts.get(attr)
-				if masters is not None:
-					masters = tuple(masters.split())
-			else:
-				masters = None
-			setattr(self, underscorized_attr, masters)
+		if local_config or 'masters' in force:
+			# Masters from repos.conf override layout.conf.
+			masters = repo_opts.get('masters')
+			if masters is not None:
+				masters = tuple(masters.split())
+		else:
+			masters = None
+
+		self.masters = masters
 
 		#The main-repo key makes only sense for the 'DEFAULT' section.
 		self.main_repo = repo_opts.get('main-repo')
@@ -220,9 +217,8 @@ class RepoConfig(object):
 
 			# layout.conf masters may be overridden here if we have a masters
 			# setting from the user's repos.conf
-			for attr, underscorized_attr in _masters_attributes.items():
-				if getattr(self, underscorized_attr) is None:
-					setattr(self, underscorized_attr, layout_data[attr])
+			if self.masters is None:
+				self.masters = layout_data['masters']
 
 			if (local_config or 'aliases' in force) and layout_data['aliases']:
 				aliases = self.aliases
@@ -375,10 +371,8 @@ class RepoConfig(object):
 			repo_msg.append(indent + "sync-type: " + self.sync_type)
 		if self.sync_uri:
 			repo_msg.append(indent + "sync-uri: " + self.sync_uri)
-		for attr, underscorized_attr in _masters_attributes.items():
-			masters = getattr(self, underscorized_attr)
-			if masters:
-				repo_msg.append(indent + attr + ": " + " ".join(master.name for master in masters))
+		if self.masters:
+			repo_msg.append(indent + "masters: " + " ".join(master.name for master in self.masters))
 		if self.priority is not None:
 			repo_msg.append(indent + "priority: " + str(self.priority))
 		if self.aliases:
@@ -750,43 +744,36 @@ class RepoConfigLoader(object):
 		for repo_name, repo in prepos.items():
 			if repo_name == "DEFAULT":
 				continue
-			for attr, underscorized_attr in _masters_attributes.items():
-				masters = getattr(repo, underscorized_attr)
-				if masters is None:
-					if attr == 'masters':
-						if self.mainRepo() and repo_name != self.mainRepo().name:
-							setattr(repo, underscorized_attr, (self.mainRepo(),))
-						else:
-							setattr(repo, underscorized_attr, ())
+			if repo.masters is None:
+				if self.mainRepo() and repo_name != self.mainRepo().name:
+					repo.masters = self.mainRepo(),
 				else:
-					if masters and isinstance(masters[0], RepoConfig):
-						# This one has already been processed
-						# because it has an alias.
-						continue
-					master_repos = []
-					for master_name in masters:
-						if master_name not in prepos:
-							layout_filename = os.path.join(repo.user_location,
-								"metadata", "layout.conf")
-							writemsg_level(_("Unavailable repository '%s' " \
-								"referenced by %s attribute in '%s'\n") % \
-								(master_name, attr, layout_filename),
-								level=logging.ERROR, noiselevel=-1)
-						else:
-							master_repos.append(prepos[master_name])
-					setattr(repo, underscorized_attr, tuple(master_repos))
+					repo.masters = ()
+			else:
+				if repo.masters and isinstance(repo.masters[0], RepoConfig):
+					# This one has already been processed
+					# because it has an alias.
+					continue
+				master_repos = []
+				for master_name in repo.masters:
+					if master_name not in prepos:
+						layout_filename = os.path.join(repo.user_location,
+							"metadata", "layout.conf")
+						writemsg_level(_("Unavailable repository '%s' " \
+							"referenced by masters entry in '%s'\n") % \
+							(master_name, layout_filename),
+							level=logging.ERROR, noiselevel=-1)
+					else:
+						master_repos.append(prepos[master_name])
+				repo.masters = tuple(master_repos)
 
 		#The 'eclass_overrides' key currently contains repo names. Replace them with the matching repo paths.
 		for repo_name, repo in prepos.items():
 			if repo_name == "DEFAULT":
 				continue
 
-			if repo.eclass_masters is not None:
-				masters = repo.eclass_masters
-			else:
-				masters = repo.masters
 			eclass_locations = []
-			eclass_locations.extend(master_repo.location for master_repo in masters)
+			eclass_locations.extend(master_repo.location for master_repo in repo.masters)
 			# Only append the current repo to eclass_locations if it's not
 			# there already. This allows masters to have more control over
 			# eclass override order, which may be useful for scenarios in
@@ -935,24 +922,23 @@ class RepoConfigLoader(object):
 		return repo_name in self.prepos
 
 	def config_string(self):
-		str_or_int_attrs = ("format", "location", "main-repo", "priority", "sync-cvs-repo", "sync-type", "sync-uri")
-		str_tuple_attrs = ("aliases", "eclass-overrides", "force")
-		repo_config_tuple_attrs = tuple(_masters_attributes.keys())
-		attrs = str_or_int_attrs + str_tuple_attrs + repo_config_tuple_attrs
+		str_or_int_keys = ("format", "location", "main_repo", "priority", "sync_cvs_repo", "sync_type", "sync_uri")
+		str_tuple_keys = ("aliases", "eclass_overrides", "force")
+		repo_config_tuple_keys = ("masters",)
+		keys = str_or_int_keys + str_tuple_keys + repo_config_tuple_keys
 		config_string = ""
 		for repo_name, repo in sorted(self.prepos.items(), key=lambda x: (x[0] != "DEFAULT", x[0])):
 			config_string += "\n[%s]\n" % repo_name
-			for attr in sorted(attrs):
-				underscorized_attr = attr.replace("-", "_").replace(".", "_")
-				if attr == "main-repo" and repo_name != "DEFAULT":
+			for key in sorted(keys):
+				if key == "main_repo" and repo_name != "DEFAULT":
 					continue
-				if getattr(repo, underscorized_attr) is not None:
-					if attr in str_or_int_attrs:
-						config_string += "%s = %s\n" % (attr, getattr(repo, underscorized_attr))
-					elif attr in str_tuple_attrs:
-						config_string += "%s = %s\n" % (attr, " ".join(getattr(repo, underscorized_attr)))
-					elif attr in repo_config_tuple_attrs:
-						config_string += "%s = %s\n" % (attr, " ".join(x.name for x in getattr(repo, underscorized_attr)))
+				if getattr(repo, key) is not None:
+					if key in str_or_int_keys:
+						config_string += "%s = %s\n" % (key.replace("_", "-"), getattr(repo, key))
+					elif key in str_tuple_keys:
+						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(getattr(repo, key)))
+					elif key in repo_config_tuple_keys:
+						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(x.name for x in getattr(repo, key)))
 		return config_string.lstrip("\n")
 
 def load_repository_config(settings, extra_files=None):
@@ -986,17 +972,15 @@ def parse_layout_conf(repo_location, repo_name=None):
 
 	data = {}
 
-	# None indicates absence of a masters setting, which later code uses
+	# None indicates abscence of a masters setting, which later code uses
 	# to trigger a backward compatibility fallback that sets an implicit
 	# master. In order to avoid this fallback behavior, layout.conf can
 	# explicitly set masters to an empty value, which will result in an
 	# empty tuple here instead of None.
-	for attr in _masters_attributes.keys():
-		masters = layout_data.get(attr)
-		if masters is not None:
-			masters = tuple(masters.split())
-		data[attr] = masters
-
+	masters = layout_data.get('masters')
+	if masters is not None:
+		masters = tuple(masters.split())
+	data['masters'] = masters
 	data['aliases'] = tuple(layout_data.get('aliases', '').split())
 
 	data['allow-provide-virtual'] = \


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, ...
@ 2014-02-28 18:48 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 4+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-02-28 18:48 UTC (permalink / raw
  To: gentoo-commits

commit:     cce641125d408e50664d255416cff785d59840cb
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Feb 28 18:48:01 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Fri Feb 28 18:48:01 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cce64112

Update dates in recently changed files.

---
 man/emerge.1                                       | 2 +-
 man/portage.5                                      | 2 +-
 pym/_emerge/create_depgraph_params.py              | 2 +-
 pym/_emerge/help.py                                | 2 +-
 pym/_emerge/unmerge.py                             | 2 +-
 pym/portage/package/ebuild/_config/MaskManager.py  | 2 +-
 pym/portage/package/ebuild/_config/UseManager.py   | 2 +-
 pym/portage/package/ebuild/fetch.py                | 2 +-
 pym/portage/package/ebuild/getmaskingreason.py     | 2 +-
 pym/portage/tests/resolver/test_multirepo.py       | 2 +-
 pym/portage/tests/resolver/test_slot_collisions.py | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index eacb77a..be22f35 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Jan 2014" "Portage VERSION" "Portage"
+.TH "EMERGE" "1" "Feb 2014" "Portage VERSION" "Portage"
 .SH "NAME"
 emerge \- Command\-line interface to the Portage system
 .SH "SYNOPSIS"

diff --git a/man/portage.5 b/man/portage.5
index 0aac569..e399f0f 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Jan 2014" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "Feb 2014" "Portage VERSION" "Portage"
 .SH NAME
 portage \- the heart of Gentoo
 .SH "DESCRIPTION"

diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index f9accf0..225b792 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import logging

diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index ab4e88f..8e241a8 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index f632a97..b04f8f3 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function

diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py
index aeb04d7..0f060c9 100644
--- a/pym/portage/package/ebuild/_config/MaskManager.py
+++ b/pym/portage/package/ebuild/_config/MaskManager.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (

diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py
index 0d00810..1c8c60e 100644
--- a/pym/portage/package/ebuild/_config/UseManager.py
+++ b/pym/portage/package/ebuild/_config/UseManager.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (

diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py
index 5984d82..2424ff3 100644
--- a/pym/portage/package/ebuild/fetch.py
+++ b/pym/portage/package/ebuild/fetch.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function

diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py
index 70a6bf2..1e4ed21 100644
--- a/pym/portage/package/ebuild/getmaskingreason.py
+++ b/pym/portage/package/ebuild/getmaskingreason.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = ['getmaskingreason']

diff --git a/pym/portage/tests/resolver/test_multirepo.py b/pym/portage/tests/resolver/test_multirepo.py
index 5c3ef7e..2b1a6d0 100644
--- a/pym/portage/tests/resolver/test_multirepo.py
+++ b/pym/portage/tests/resolver/test_multirepo.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase

diff --git a/pym/portage/tests/resolver/test_slot_collisions.py b/pym/portage/tests/resolver/test_slot_collisions.py
index 85afc09..9fcd529 100644
--- a/pym/portage/tests/resolver/test_slot_collisions.py
+++ b/pym/portage/tests/resolver/test_slot_collisions.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011,2014 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-28 18:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12  7:29 [gentoo-commits] proj/portage:master commit in: man/, pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2014-01-18 11:36 Arfrever Frehtes Taifersar Arahesis
2014-02-09 22:40 Brian Dolbec
2014-02-28 18:48 Arfrever Frehtes Taifersar Arahesis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox