commit: 378e6f32f15ce3ce0c22fd31a90c79efa01c3def Author: Felix Bier <felix.bier <AT> rohde-schwarz <DOT> com> AuthorDate: Wed Mar 17 22:51:05 2021 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sun Mar 28 09:02:40 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=378e6f32
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 <AT> rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/portage/repository/config.py | 5 ++++- .../binpkg_multi_instance/test_build_id_profile_format.py | 13 ++++++++++--- man/portage.5 | 6 ++++-- 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
