* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/
@ 2011-10-08 22:52 Zac Medico
0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2011-10-08 22:52 UTC (permalink / raw
To: gentoo-commits
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():
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/
@ 2011-10-28 6:17 Zac Medico
0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2011-10-28 6:17 UTC (permalink / raw
To: gentoo-commits
commit: 46d97be05dae690373ef802788adb5cf1505f947
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 06:17:19 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 06:17:19 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=46d97be0
RepoConfigLoader: support incremental aliases
This allows a user to discard unwanted aliases that are specified in
a repo's layout.conf.
---
man/portage.5 | 5 +++--
pym/portage/repository/config.py | 16 +++++++---------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/man/portage.5 b/man/portage.5
index 45eef36..7fa5660 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -708,8 +708,9 @@ eclass\-overrides = java\-overlay java\-experimental
# disable all eclass overrides for ebuilds from the gentoo repository
eclass\-overrides =
# when processing metadata/layout.conf from other repositories, substitute
-# 'gentoo' in place of references to repositories named 'foo' and 'bar'
-aliases = foo bar
+# 'gentoo' in place of references to repositories named 'foo' and 'bar',
+# and discard the 'baz' alias contained in gentoo's layout.conf
+aliases = foo bar -baz
[kde-testing]
# override the metadata/layout.conf masters setting from the kde-testing repo
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5b5ddd6..1a7effe 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -19,7 +19,8 @@ from portage import os
from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
REPO_NAME_LOC, USER_CONFIG_PATH)
from portage.env.loaders import KeyValuePairFileLoader
-from portage.util import normalize_path, writemsg, writemsg_level, shlex_split
+from portage.util import (normalize_path, writemsg, writemsg_level,
+ shlex_split, stack_lists)
from portage.localization import _
from portage import _unicode_decode
from portage import _unicode_encode
@@ -390,17 +391,13 @@ class RepoConfigLoader(object):
if repo.masters is None:
repo.masters = layout_data['masters']
- aliases = layout_data.get('aliases')
- if aliases and aliases.strip():
- aliases = aliases.split()
- else:
- aliases = None
-
if layout_data['aliases']:
aliases = repo.aliases
if aliases is None:
aliases = ()
- repo.aliases = tuple(aliases) + layout_data['aliases']
+ # repos.conf aliases come after layout.conf aliases, giving
+ # them the ability to do incremental overrrides
+ repo.aliases = layout_data['aliases'] + tuple(aliases)
for value in ('sign-manifest', 'thin-manifest', 'allow-missing-manifest',
'create-manifest', 'disable-manifest', 'cache-formats', 'manifest-hashes',
@@ -417,7 +414,8 @@ class RepoConfigLoader(object):
names = set()
names.add(repo_name)
if repo.aliases:
- names.update(repo.aliases)
+ aliases = stack_lists([repo.aliases], incremental=True)
+ names.update(aliases)
for name in names:
if name in new_prepos:
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/
@ 2013-06-19 18:52 Zac Medico
0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2013-06-19 18:52 UTC (permalink / raw
To: gentoo-commits
commit: 365ecd3654655939758186c8f0234542bc4a44a6
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 18:51:34 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 18:51:34 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=365ecd36
RepoConfig: safe config for repoman/egencache
For repoman/egencache, omit local configuration overrides involving
aliases, eclass-overrides, and masters.
---
man/portage.5 | 4 +--
pym/portage/repository/config.py | 67 ++++++++++++++++++++++++++--------------
2 files changed, 45 insertions(+), 26 deletions(-)
diff --git a/man/portage.5 b/man/portage.5
index 7b13073..505990c 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "May 2013" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "Jun 2013" "Portage VERSION" "Portage"
.SH NAME
portage \- the heart of Gentoo
.SH "DESCRIPTION"
@@ -756,7 +756,7 @@ x11\-libs/qt \-mysql
.TP
.BR repos.conf
Specifies \fIsite\-specific\fR repository configuration information. Note that
-configuration settings which are specified here do not apply to tools
+local configuration overrides which are specified here do not apply to tools
such as \fBrepoman\fR(1) and \fBegencache\fR(1), since operations
performed by these tools
are inherently \fBnot\fR \fIsite\-specific\fR. \fBWARNING:\fR Use of
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 508a56e..7c69fb4 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -76,34 +76,49 @@ class RepoConfig(object):
__slots__ = ('aliases', 'allow_missing_manifest', 'allow_provide_virtual',
'cache_formats', 'create_manifest', 'disable_manifest', 'eapi',
'eclass_db', 'eclass_locations', 'eclass_overrides',
- 'find_invalid_path_char', 'format', 'location',
+ 'find_invalid_path_char', 'format', 'local_config', 'location',
'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
'profile_formats', 'sign_commit', 'sign_manifest', 'sync',
'thin_manifest', 'update_changelog', 'user_location',
'_eapis_banned', '_eapis_deprecated')
- def __init__(self, name, repo_opts):
+ def __init__(self, name, repo_opts, local_config=True):
"""Build a RepoConfig with options in repo_opts
Try to read repo_name in repository location, but if
it is not found use variable name as repository name"""
- aliases = repo_opts.get('aliases')
- if aliases is not None:
- aliases = tuple(aliases.split())
+
+ self.local_config = local_config
+
+ if local_config:
+ aliases = repo_opts.get('aliases')
+ if aliases is not None:
+ aliases = tuple(aliases.split())
+ else:
+ aliases = None
+
self.aliases = aliases
- eclass_overrides = repo_opts.get('eclass-overrides')
- if eclass_overrides is not None:
- eclass_overrides = tuple(eclass_overrides.split())
+ if local_config:
+ eclass_overrides = repo_opts.get('eclass-overrides')
+ if eclass_overrides is not None:
+ 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
- # Masters from repos.conf override layout.conf.
- masters = repo_opts.get('masters')
- if masters is not None:
- masters = tuple(masters.split())
+ if local_config:
+ # 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.
@@ -173,7 +188,7 @@ class RepoConfig(object):
if self.masters is None:
self.masters = layout_data['masters']
- if layout_data['aliases']:
+ if local_config and layout_data['aliases']:
aliases = self.aliases
if aliases is None:
aliases = ()
@@ -352,7 +367,8 @@ class RepoConfigLoader(object):
"""Loads and store config of several repositories, loaded from PORTDIR_OVERLAY or repos.conf"""
@staticmethod
- def _add_repositories(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map):
+ def _add_repositories(portdir, portdir_overlay, prepos,
+ ignored_map, ignored_location_map, local_config):
"""Add overlays in PORTDIR_OVERLAY as repositories"""
overlays = []
portdir_orig = None
@@ -395,7 +411,7 @@ class RepoConfigLoader(object):
if isdir_raise_eaccess(ov):
repo_opts = default_repo_opts.copy()
repo_opts['location'] = ov
- repo = RepoConfig(None, repo_opts)
+ repo = RepoConfig(None, repo_opts, local_config=local_config)
# repos_conf_opts contains options from repos.conf
repos_conf_opts = repos_conf.get(repo.name)
if repos_conf_opts is not None:
@@ -443,7 +459,7 @@ class RepoConfigLoader(object):
return portdir
@staticmethod
- def _parse(paths, prepos, ignored_map, ignored_location_map):
+ def _parse(paths, prepos, ignored_map, ignored_location_map, local_config):
"""Parse files in paths to load config"""
parser = SafeConfigParser()
@@ -476,13 +492,15 @@ class RepoConfigLoader(object):
if f is not None:
f.close()
- prepos['DEFAULT'] = RepoConfig("DEFAULT", parser.defaults())
+ prepos['DEFAULT'] = RepoConfig("DEFAULT",
+ parser.defaults(), local_config=local_config)
+
for sname in parser.sections():
optdict = {}
for oname in parser.options(sname):
optdict[oname] = parser.get(sname, oname)
- repo = RepoConfig(sname, optdict)
+ repo = RepoConfig(sname, optdict, local_config=local_config)
if repo.location and not exists_raise_eaccess(repo.location):
writemsg(_("!!! Invalid repos.conf entry '%s'"
" (not a dir): '%s'\n") % (sname, repo.location), noiselevel=-1)
@@ -510,7 +528,8 @@ class RepoConfigLoader(object):
portdir_overlay = settings.get('PORTDIR_OVERLAY', '')
try:
- self._parse(paths, prepos, ignored_map, ignored_location_map)
+ self._parse(paths, prepos, ignored_map,
+ ignored_location_map, settings.local_config)
except ConfigParserError as e:
writemsg(
_("!!! Error while reading repo config file: %s\n") % e,
@@ -519,7 +538,8 @@ class RepoConfigLoader(object):
# exceptions) after it has thrown an error, so use empty
# config and try to fall back to PORTDIR{,_OVERLAY}.
prepos.clear()
- prepos['DEFAULT'] = RepoConfig('DEFAULT', {})
+ prepos['DEFAULT'] = RepoConfig('DEFAULT',
+ {}, local_config=settings.local_config)
location_map.clear()
treemap.clear()
ignored_map.clear()
@@ -528,7 +548,7 @@ class RepoConfigLoader(object):
# If PORTDIR_OVERLAY contains a repo with the same repo_name as
# PORTDIR, then PORTDIR is overridden.
portdir = self._add_repositories(portdir, portdir_overlay, prepos,
- ignored_map, ignored_location_map)
+ ignored_map, ignored_location_map, settings.local_config)
if portdir and portdir.strip():
portdir = os.path.realpath(portdir)
@@ -762,9 +782,8 @@ class RepoConfigLoader(object):
def load_repository_config(settings):
#~ repoconfigpaths = [os.path.join(settings.global_config_path, "repos.conf")]
repoconfigpaths = []
- if settings.local_config:
- repoconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
- USER_CONFIG_PATH, "repos.conf"))
+ repoconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
+ USER_CONFIG_PATH, "repos.conf"))
return RepoConfigLoader(repoconfigpaths, settings)
def _get_repo_name(repo_location, cached=None):
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/
@ 2013-07-24 0:36 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 4+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-24 0:36 UTC (permalink / raw
To: gentoo-commits
commit: 4c4f95b81294b8ef7673938ce3e6c95f0d814dfc
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Jul 24 00:34:56 2013 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Wed Jul 24 00:34:56 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4c4f95b8
Bug #477452: Support force attribute in repos.conf.
---
man/portage.5 | 36 ++++++++++++++++++++++++++++++------
pym/portage/repository/config.py | 24 +++++++++++++++---------
2 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/man/portage.5 b/man/portage.5
index 8dc33fb..796047f 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -781,9 +781,16 @@ Setting this attribute is generally not recommended since resulting changes
in eclass inheritance may trigger performance issues due to invalidation
of metadata cache.
.br
-Tools such as \fBrepoman\fR(1) and \fBegencache\fR(1) ignore this attribute,
+When 'force = eclass\-overrides' 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 force
+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
.RE
.I Attributes supported in sections of repositories:
@@ -791,6 +798,15 @@ since operations performed by these tools are inherently
.TP
.B aliases
Specifies aliases of given repository.
+.br
+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 = aliases' 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 eclass\-overrides
Makes given repository inherit eclasses from specified repositories.
@@ -799,10 +815,17 @@ Setting this attribute is generally not recommended since resulting changes
in eclass inheritance may trigger performance issues due to invalidation
of metadata cache.
.br
-Tools such as \fBrepoman\fR(1) and \fBegencache\fR(1) ignore this attribute,
+When 'force = eclass\-overrides' 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 force
+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
+.TP
.B location
Specifies location of given repository.
.TP
@@ -813,7 +836,8 @@ Setting this attribute is generally not recommended since resulting changes
in eclass inheritance may trigger performance issues due to invalidation
of metadata cache.
.br
-Tools such as \fBrepoman\fR(1) and \fBegencache\fR(1) ignore this attribute,
+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
@@ -891,9 +915,9 @@ masters =
# Repository 'gentoo' synchronized using CVS
[gentoo]
location = /usr/portage
-sync-type = cvs
-sync-uri = :pserver:anonymous@anoncvs.gentoo.org:/var/cvsroot
-sync-cvs-repo = gentoo-x86
+sync\-type = cvs
+sync\-uri = :pserver:anonymous@anoncvs.gentoo.org:/var/cvsroot
+sync\-cvs\-repo = gentoo\-x86
.fi
.RE
.RE
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 68e8121..de471e9 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -79,7 +79,7 @@ class RepoConfig(object):
__slots__ = ('aliases', 'allow_missing_manifest', 'allow_provide_virtual',
'cache_formats', 'create_manifest', 'disable_manifest', 'eapi',
'eclass_db', 'eclass_locations', 'eclass_overrides',
- 'find_invalid_path_char', 'format', 'local_config', 'location',
+ 'find_invalid_path_char', 'force', 'format', 'local_config', 'location',
'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
'profile_formats', 'sign_commit', 'sign_manifest', 'sync_cvs_repo',
@@ -91,9 +91,16 @@ class RepoConfig(object):
Try to read repo_name in repository location, but if
it is not found use variable name as repository name"""
+ force = repo_opts.get('force')
+ if force is not None:
+ force = tuple(force.split())
+ self.force = force
+ if force is None:
+ force = ()
+
self.local_config = local_config
- if local_config:
+ if local_config or 'aliases' in force:
aliases = repo_opts.get('aliases')
if aliases is not None:
aliases = tuple(aliases.split())
@@ -102,7 +109,7 @@ class RepoConfig(object):
self.aliases = aliases
- if local_config:
+ if local_config or 'eclass-overrides' in force:
eclass_overrides = repo_opts.get('eclass-overrides')
if eclass_overrides is not None:
eclass_overrides = tuple(eclass_overrides.split())
@@ -114,7 +121,7 @@ class RepoConfig(object):
self.eclass_db = None
self.eclass_locations = None
- if local_config:
+ if local_config or 'masters' in force:
# Masters from repos.conf override layout.conf.
masters = repo_opts.get('masters')
if masters is not None:
@@ -204,7 +211,7 @@ class RepoConfig(object):
if self.masters is None:
self.masters = layout_data['masters']
- if local_config and layout_data['aliases']:
+ if (local_config or 'aliases' in force) and layout_data['aliases']:
aliases = self.aliases
if aliases is None:
aliases = ()
@@ -437,9 +444,8 @@ class RepoConfigLoader(object):
if repos_conf_opts is not None:
# Selectively copy only the attributes which
# repos.conf is allowed to override.
- for k in ('aliases', 'eclass_overrides', 'masters',
- 'priority', 'sync_cvs_repo', 'sync_type',
- 'sync_uri'):
+ for k in ('aliases', 'eclass_overrides', 'force', 'masters',
+ 'priority', 'sync_cvs_repo', 'sync_type', 'sync_uri'):
v = getattr(repos_conf_opts, k, None)
if v is not None:
setattr(repo, k, v)
@@ -877,7 +883,7 @@ class RepoConfigLoader(object):
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")
+ 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 = ""
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-24 0:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-19 18:52 [gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2013-07-24 0:36 Arfrever Frehtes Taifersar Arahesis
2011-10-28 6:17 Zac Medico
2011-10-08 22:52 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox