* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/
@ 2018-10-08 22:35 Zac Medico
0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2018-10-08 22:35 UTC (permalink / raw
To: gentoo-commits
commit: 9b8263d38ffe6213056332d38162048a0cd28857
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Sep 26 21:44:59 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 8 21:56:26 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9b8263d3
portage.repository.config: Sort some tuples and put each element on separate line.
It will make future changes easier and more readable.
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/portage/repository/config.py | 122 +++++++++++++++++++++++++++++----------
1 file changed, 92 insertions(+), 30 deletions(-)
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 8cdc2a696..482711c4b 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -74,29 +74,61 @@ def _find_invalid_path_char(path, pos=0, endpos=None):
class RepoConfig(object):
"""Stores config of one repository"""
- __slots__ = ('aliases', 'allow_missing_manifest', 'allow_provide_virtual',
- 'auto_sync', 'cache_formats', 'clone_depth',
- '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',
- 'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
- 'profile_formats', 'sign_commit', 'sign_manifest', 'strict_misc_digests',
- 'sync_depth', 'sync_hooks_only_on_change',
- 'sync_type', 'sync_umask', 'sync_uri', 'sync_user', 'thin_manifest',
- 'update_changelog', 'user_location', '_eapis_banned', '_eapis_deprecated',
- '_masters_orig', 'module_specific_options', 'manifest_required_hashes',
+ __slots__ = (
+ 'aliases',
+ 'allow_missing_manifest',
+ 'allow_provide_virtual',
+ 'auto_sync',
+ 'cache_formats',
+ 'clone_depth',
+ 'create_manifest',
+ 'disable_manifest',
+ 'eapi',
+ 'eclass_db',
+ 'eclass_locations',
+ 'eclass_overrides',
+ 'find_invalid_path_char',
+ 'force',
+ 'format',
+ 'local_config',
+ 'location',
+ 'main_repo',
+ 'manifest_hashes',
+ 'manifest_required_hashes',
+ 'masters',
+ 'missing_repo_name',
+ 'module_specific_options',
+ 'name',
+ 'portage1_profiles',
+ 'portage1_profiles_compat',
+ 'priority',
+ 'profile_formats',
+ 'sign_commit',
+ 'sign_manifest',
+ 'strict_misc_digests',
'sync_allow_hardlinks',
+ 'sync_depth',
+ 'sync_hooks_only_on_change',
'sync_openpgp_key_path',
'sync_openpgp_key_refresh_retry_count',
- 'sync_openpgp_key_refresh_retry_delay_max',
'sync_openpgp_key_refresh_retry_delay_exp_base',
+ 'sync_openpgp_key_refresh_retry_delay_max',
'sync_openpgp_key_refresh_retry_delay_mult',
'sync_openpgp_key_refresh_retry_overall_timeout',
'sync_rcu',
- 'sync_rcu_store_dir',
'sync_rcu_spare_snapshots',
+ 'sync_rcu_store_dir',
'sync_rcu_ttl_days',
+ 'sync_type',
+ 'sync_umask',
+ 'sync_uri',
+ 'sync_user',
+ 'thin_manifest',
+ 'update_changelog',
+ 'user_location',
+ '_eapis_banned',
+ '_eapis_deprecated',
+ '_masters_orig',
)
def __init__(self, name, repo_opts, local_config=True):
@@ -196,8 +228,8 @@ class RepoConfig(object):
'sync-openpgp-key-path', None)
for k in ('sync_openpgp_key_refresh_retry_count',
- 'sync_openpgp_key_refresh_retry_delay_max',
'sync_openpgp_key_refresh_retry_delay_exp_base',
+ 'sync_openpgp_key_refresh_retry_delay_max',
'sync_openpgp_key_refresh_retry_delay_mult',
'sync_openpgp_key_refresh_retry_overall_timeout'):
setattr(self, k, repo_opts.get(k.replace('_', '-'), None))
@@ -556,23 +588,34 @@ 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', 'auto_sync',
- 'clone_depth', 'eclass_overrides',
- 'force', 'masters', 'priority', 'strict_misc_digests',
- 'sync_depth', 'sync_hooks_only_on_change',
+ for k in (
+ 'aliases',
+ 'auto_sync',
+ 'clone_depth',
+ 'eclass_overrides',
+ 'force',
+ 'masters',
+ 'module_specific_options',
+ 'priority',
+ 'strict_misc_digests',
'sync_allow_hardlinks',
+ 'sync_depth',
+ 'sync_hooks_only_on_change',
'sync_openpgp_key_path',
'sync_openpgp_key_refresh_retry_count',
- 'sync_openpgp_key_refresh_retry_delay_max',
'sync_openpgp_key_refresh_retry_delay_exp_base',
+ 'sync_openpgp_key_refresh_retry_delay_max',
'sync_openpgp_key_refresh_retry_delay_mult',
'sync_openpgp_key_refresh_retry_overall_timeout',
'sync_rcu',
- 'sync_rcu_store_dir',
'sync_rcu_spare_snapshots',
+ 'sync_rcu_store_dir',
'sync_rcu_ttl_days',
- 'sync_type', 'sync_umask', 'sync_uri', 'sync_user',
- 'module_specific_options'):
+ 'sync_type',
+ 'sync_umask',
+ 'sync_uri',
+ 'sync_user',
+ ):
v = getattr(repos_conf_opts, k, None)
if v is not None:
setattr(repo, k, v)
@@ -991,19 +1034,38 @@ class RepoConfigLoader(object):
return repo_name in self.prepos
def config_string(self):
- bool_keys = ("strict_misc_digests", "sync_allow_hardlinks", "sync_rcu")
- str_or_int_keys = ("auto_sync", "clone_depth", "format", "location",
- "main_repo", "priority", "sync_depth", "sync_openpgp_key_path",
+ bool_keys = (
+ "strict_misc_digests",
+ "sync_allow_hardlinks",
+ "sync_rcu",
+ )
+ str_or_int_keys = (
+ "auto_sync",
+ "clone_depth",
+ "format",
+ "location",
+ "main_repo",
+ "priority",
+ "sync_depth",
+ "sync_openpgp_key_path",
"sync_openpgp_key_refresh_retry_count",
- "sync_openpgp_key_refresh_retry_delay_max",
"sync_openpgp_key_refresh_retry_delay_exp_base",
+ "sync_openpgp_key_refresh_retry_delay_max",
"sync_openpgp_key_refresh_retry_delay_mult",
"sync_openpgp_key_refresh_retry_overall_timeout",
- "sync_rcu_store_dir",
"sync_rcu_spare_snapshots",
+ "sync_rcu_store_dir",
"sync_rcu_ttl_days",
- "sync_type", "sync_umask", "sync_uri", 'sync_user')
- str_tuple_keys = ("aliases", "eclass_overrides", "force")
+ "sync_type",
+ "sync_umask",
+ "sync_uri",
+ "sync_user",
+ )
+ str_tuple_keys = (
+ "aliases",
+ "eclass_overrides",
+ "force",
+ )
repo_config_tuple_keys = ("masters",)
keys = bool_keys + str_or_int_keys + str_tuple_keys + repo_config_tuple_keys
config_string = ""
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/
@ 2019-04-24 18:19 Zac Medico
0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2019-04-24 18:19 UTC (permalink / raw
To: gentoo-commits
commit: f91508ed8323ec4022989b377cc6e4176d273413
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 24 18:12:41 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 24 18:17:11 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f91508ed
RepoConfigLoader: fix default_portdir value (bug 478544)
Fixes: a859556ffaa4 ("Update /usr/portage references (bug 378603)")
Bug: https://bugs.gentoo.org/478544
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/portage/repository/config.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 67a6897f7..2b2b1e151 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2018 Gentoo Foundation
+# Copyright 2010-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
@@ -733,8 +733,11 @@ class RepoConfigLoader(object):
location_map.clear()
treemap.clear()
- default_portdir = os.path.join(os.sep,
- settings['EPREFIX'].lstrip(os.sep), 'usr', 'portage')
+ repo_locations = frozenset(repo.location for repo in prepos.values())
+ for repo_location in ('var/db/repos/gentoo', 'usr/portage'):
+ default_portdir = os.path.join(os.sep, settings['EPREFIX'].lstrip(os.sep), repo_location)
+ if default_portdir in repo_locations:
+ break
# If PORTDIR_OVERLAY contains a repo with the same repo_name as
# PORTDIR, then PORTDIR is overridden.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/
@ 2019-08-24 2:40 Zac Medico
0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2019-08-24 2:40 UTC (permalink / raw
To: gentoo-commits
commit: 453c02fa66c76e776d789cb2edc1768396eb0c6d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 24 01:57:02 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 02:10:47 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=453c02fa
RepoConfig: add properties-allowed attribute
Bug: https://bugs.gentoo.org/690786
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/portage/repository/config.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 46bb6b65a..50ab18026 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -103,6 +103,7 @@ class RepoConfig(object):
'portage1_profiles_compat',
'priority',
'profile_formats',
+ 'properties_allowed',
'restrict_allowed',
'sign_commit',
'sign_manifest',
@@ -340,7 +341,7 @@ class RepoConfig(object):
for value in ('allow-missing-manifest',
'cache-formats',
'create-manifest', 'disable-manifest', 'manifest-hashes',
- 'manifest-required-hashes', 'profile-formats', 'restrict-allowed',
+ 'manifest-required-hashes', 'profile-formats', 'properties-allowed', 'restrict-allowed',
'sign-commit', 'sign-manifest', 'thin-manifest', 'update-changelog'):
setattr(self, value.lower().replace("-", "_"), layout_data[value])
@@ -1143,6 +1144,11 @@ def parse_layout_conf(repo_location, repo_name=None):
data['eapis-banned'] = tuple(layout_data.get('eapis-banned', '').split())
data['eapis-deprecated'] = tuple(layout_data.get('eapis-deprecated', '').split())
+ properties_allowed = layout_data.get('properties-allowed')
+ if properties_allowed is not None:
+ properties_allowed = tuple(properties_allowed.split())
+ data['properties-allowed'] = properties_allowed
+
restrict_allowed = layout_data.get('restrict-allowed')
if restrict_allowed is not None:
restrict_allowed = tuple(restrict_allowed.split())
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/
@ 2021-02-27 1:28 Zac Medico
0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2021-02-27 1:28 UTC (permalink / raw
To: gentoo-commits
commit: 396b1ea5a7a0f868abe6b0b08352243f8fd48f35
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 27 01:26:06 2021 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 27 01:27:07 2021 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=396b1ea5
RepoConfig.config_string: don't override repos with aliases (bug 749333)
Bug: https://bugs.gentoo.org/749333
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/portage/repository/config.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index f7c956dd8..83e9746d1 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -1076,6 +1076,8 @@ class RepoConfigLoader:
keys = bool_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])):
+ if repo_name != repo.name:
+ continue
config_string += "\n[%s]\n" % repo_name
for key in sorted(keys):
if key == "main_repo" and repo_name != "DEFAULT":
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/
@ 2022-12-21 1:44 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2022-12-21 1:44 UTC (permalink / raw
To: gentoo-commits
commit: f552c3878eef61da856d462a73989d579fe5fefe
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 21 01:43:49 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 21 01:43:58 2022 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f552c387
config: add missing Pathlib import
Signed-off-by: Sam James <sam <AT> gentoo.org>
lib/portage/repository/config.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 97feb6632..1e4d0b707 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -9,6 +9,7 @@ import re
import typing
import portage
+from pathlib import Path
from portage import eclass_cache, os
from portage.checksum import get_valid_checksum_keys
from portage.const import PORTAGE_BASE_PATH, REPO_NAME_LOC, USER_CONFIG_PATH
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/
@ 2022-12-21 1:49 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2022-12-21 1:49 UTC (permalink / raw
To: gentoo-commits
commit: 1589274ca28c9c5394c056b469957715c6d4e4b9
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 21 01:49:10 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 21 01:49:10 2022 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1589274c
config: fix Pathlib attribute
Signed-off-by: Sam James <sam <AT> gentoo.org>
lib/portage/repository/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 1e4d0b707..f540265dd 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -357,7 +357,7 @@ class RepoConfig:
# If the owner of the repository isn't root or Portage, it's
# an indication the user may expect to be able to safely make
# changes in the directory, so default to volatile.
- elif Path(self.location).user not in ("root", "portage"):
+ elif Path(self.location).owner not in ("root", "portage"):
self.volatile = True
else:
self.volatile = False
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/portage:master commit in: lib/portage/repository/
@ 2023-02-26 20:12 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2023-02-26 20:12 UTC (permalink / raw
To: gentoo-commits
commit: bd8f9f6c590dca750285e296a6c3d530f1053d89
Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 26 19:47:01 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 20:12:04 2023 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=bd8f9f6c
repository: config: fix volatile detection, add missing () operator
Path(self.location).owner was missing the function-call operator.
Closes: https://bugs.gentoo.org/895526
Fixes: ef123a214708 ("config: Add 'volatile' configuration option")
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/997
Signed-off-by: Sam James <sam <AT> gentoo.org>
lib/portage/repository/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index ace119bf4..8688c633d 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -357,7 +357,7 @@ class RepoConfig:
# If the owner of the repository isn't root or Portage, it's
# an indication the user may expect to be able to safely make
# changes in the directory, so default to volatile.
- elif Path(self.location).owner not in ("root", "portage"):
+ elif Path(self.location).owner() not in ("root", "portage"):
self.volatile = True
else:
self.volatile = False
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-02-26 20:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 1:44 [gentoo-commits] proj/portage:master commit in: lib/portage/repository/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2023-02-26 20:12 Sam James
2022-12-21 1:49 Sam James
2021-02-27 1:28 Zac Medico
2019-08-24 2:40 Zac Medico
2019-04-24 18:19 Zac Medico
2018-10-08 22:35 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox