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:
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
\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
\- attributes are specified in "${attribute} = ${value}" format
.fi
-.I Supported attributes.
+.I Supported attributes:
.RS
.RS
.TP
.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,
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
.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"
_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):
'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
aliases = tuple(aliases.split())
else:
aliases = None
-
self.aliases = aliases
if local_config or 'eclass-overrides' in force:
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')
# 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
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:
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
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):
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'] = \