aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Bier <felix.bier@rohde-schwarz.com>2021-03-17 23:51:05 +0100
committerZac Medico <zmedico@gentoo.org>2021-03-28 02:02:40 -0700
commit378e6f32f15ce3ce0c22fd31a90c79efa01c3def (patch)
treeec381f38deae028dd23d103374f640a625896c4a
parentAtom: Decouple eapi and allow_repo (diff)
downloadportage-378e6f32f15ce3ce0c22fd31a90c79efa01c3def.tar.gz
portage-378e6f32f15ce3ce0c22fd31a90c79efa01c3def.tar.bz2
portage-378e6f32f15ce3ce0c22fd31a90c79efa01c3def.zip
Add profile format extension for repo atoms
This commit adds a profile format extension that allows to use repo atoms in profile files. Bug: https://bugs.gentoo.org/651208 Closes: https://github.com/gentoo/portage/pull/687 Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/repository/config.py5
-rw-r--r--lib/portage/tests/resolver/binpkg_multi_instance/test_build_id_profile_format.py13
-rw-r--r--man/portage.56
3 files changed, 18 insertions, 6 deletions
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index c401d10b4..d81559e3a 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -48,7 +48,7 @@ _invalid_path_char_re = re.compile(r'[^a-zA-Z0-9._\-+/]')
_valid_profile_formats = frozenset(
['pms', 'portage-1', 'portage-2', 'profile-bashrcs', 'profile-set',
- 'profile-default-eapi', 'build-id'])
+ 'profile-default-eapi', 'build-id', 'profile-repo-deps'])
_portage1_profiles_allow_directories = frozenset(
["portage-1-compat", "portage-1", 'portage-2'])
@@ -1119,6 +1119,9 @@ def allow_profile_repo_deps(
if eapi_has_repo_deps(repo.eapi):
return True
+ if 'profile-repo-deps' in repo.profile_formats:
+ return True
+
return False
def load_repository_config(settings, extra_files=None):
diff --git a/lib/portage/tests/resolver/binpkg_multi_instance/test_build_id_profile_format.py b/lib/portage/tests/resolver/binpkg_multi_instance/test_build_id_profile_format.py
index 0397509f8..97a54bd24 100644
--- a/lib/portage/tests/resolver/binpkg_multi_instance/test_build_id_profile_format.py
+++ b/lib/portage/tests/resolver/binpkg_multi_instance/test_build_id_profile_format.py
@@ -1,4 +1,4 @@
-# Copyright 2015 Gentoo Foundation
+# Copyright 2015-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
@@ -10,14 +10,21 @@ class BuildIdProfileFormatTestCase(TestCase):
def testBuildIdProfileFormat(self):
profile = {
- "packages": ("=app-misc/A-1-2",),
+ "packages": ("=app-misc/A-1-2::test_repo",),
+ "package.mask": ("<app-misc/A-1::test_repo",),
+ "package.keywords": ("app-misc/A-1::test_repo x86",),
+ "package.use": ("app-misc/A-1::test_repo foo",),
+ "package.use.mask": ("app-misc/A-1::test_repo -foo",),
+ "package.use.stable.mask": ("app-misc/A-1::test_repo -foo",),
+ "package.use.force": ("app-misc/A-1::test_repo foo",),
+ "package.use.stable.force": ("app-misc/A-1::test_repo foo",),
"package.provided": ("sys-libs/zlib-1.2.8-r1",),
}
repo_configs = {
"test_repo": {
"layout.conf": (
- "profile-formats = build-id profile-set",
+ "profile-formats = build-id profile-repo-deps profile-set",
),
}
}
diff --git a/man/portage.5 b/man/portage.5
index f6ec1b0fa..247ec5ab0 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Sep 2020" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "Mar 2021" "Portage VERSION" "Portage"
.SH NAME
portage \- the heart of Gentoo
.SH "DESCRIPTION"
@@ -1466,7 +1466,7 @@ The EAPI to use for profiles when unspecified. This attribute is
supported only if profile-default-eapi is included in profile-formats.
.TP
.BR profile\-formats " = [pms] [portage-1] [portage-2] [profile-bashrcs] \
-[profile-set] [profile-default-eapi] [build-id]"
+[profile-set] [profile-default-eapi] [build-id] [profile-repo-deps]"
Control functionality available to profiles in this repo such as which files
may be dirs, or the syntax available in parent files. Use "portage-2" if you're
unsure. The default is "portage-1-compat" mode which is meant to be compatible
@@ -1481,6 +1481,8 @@ dependency atoms in the profile to refer to specific builds (see the
binpkg\-multi\-instance FEATURES setting in \fBmake.conf\fR(5)). A
build\-id atom is identical to a version-specific atom, except that the
version is followed by a hyphen and an integer build\-id.
+Setting profile\-repo\-deps allows dependency atoms in the profile to
+refer to specific repositories.
.RE
.RE