diff options
author | 2012-09-09 00:15:09 +0100 | |
---|---|---|
committer | 2012-09-09 00:15:09 +0100 | |
commit | c4ba9866a1f4c7474befb0cdfe894494a6d5b19b (patch) | |
tree | b8567cec8294c5e9f543a1c87528a4553f39b615 | |
parent | c7e1dfb2b57d8f50760651cf20da595f768b3f96 (diff) | |
download | paludis-c4ba9866a1f4c7474befb0cdfe894494a6d5b19b.tar.gz paludis-c4ba9866a1f4c7474befb0cdfe894494a6d5b19b.tar.xz |
Support (package.)use.stable.(mask|force) in EAPI 5 profiles
-rw-r--r-- | paludis/repositories/e/e_repository_TEST.cc | 201 | ||||
-rwxr-xr-x | paludis/repositories/e/e_repository_TEST_setup.sh | 122 | ||||
-rw-r--r-- | paludis/repositories/e/eapi-fwd.hh | 1 | ||||
-rw-r--r-- | paludis/repositories/e/eapi.cc | 8 | ||||
-rw-r--r-- | paludis/repositories/e/eapi.hh | 8 | ||||
-rw-r--r-- | paludis/repositories/e/eapis/0.conf | 2 | ||||
-rw-r--r-- | paludis/repositories/e/eapis/5.conf | 2 | ||||
-rw-r--r-- | paludis/repositories/e/eapis/exheres-0.conf | 2 | ||||
-rw-r--r-- | paludis/repositories/e/eapis/paludis-1.conf | 2 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild_id.cc | 38 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild_id.hh | 1 | ||||
-rw-r--r-- | paludis/repositories/e/exheres_profile.cc | 4 | ||||
-rw-r--r-- | paludis/repositories/e/exheres_profile.hh | 4 | ||||
-rw-r--r-- | paludis/repositories/e/profile.hh | 6 | ||||
-rw-r--r-- | paludis/repositories/e/traditional_profile.cc | 57 | ||||
-rw-r--r-- | paludis/repositories/e/traditional_profile.hh | 4 |
16 files changed, 441 insertions, 21 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc index 2a69a60a3..3de7415a4 100644 --- a/paludis/repositories/e/e_repository_TEST.cc +++ b/paludis/repositories/e/e_repository_TEST.cc @@ -568,6 +568,207 @@ TEST_F(ERepositoryQueryUseTest, QueryUse) } } +TEST_F(ERepositoryQueryUseTest, UseStableMaskForce) +{ + bool accept_unstable(false); + do + { + TestEnvironment env(accept_unstable); + + std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>()); + keys->insert("format", "e"); + keys->insert("names_cache", "/var/empty"); + keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo9a")); + keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo9a/profiles/eapi5/child")); + keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build")); + std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env, + std::bind(from_keys, keys, std::placeholders::_1)))); + env.add_repository(1, repo); + + for (int pass = 1 ; pass <= 2 ; ++pass) + { + const std::shared_ptr<const PackageID> stable1(*env[selection::RequireExactlyOne(generator::Matches( + PackageDepSpec(parse_user_package_dep_spec("=cat/stable-1", + &env, { })), make_null_shared_ptr(), { }))]->begin()); + const std::shared_ptr<const PackageID> stable1r1(*env[selection::RequireExactlyOne(generator::Matches( + PackageDepSpec(parse_user_package_dep_spec("=cat/stable-1-r1", + &env, { })), make_null_shared_ptr(), { }))]->begin()); + const std::shared_ptr<const PackageID> stable2(*env[selection::RequireExactlyOne(generator::Matches( + PackageDepSpec(parse_user_package_dep_spec("=cat/stable-2", + &env, { })), make_null_shared_ptr(), { }))]->begin()); + const std::shared_ptr<const PackageID> unstable1(*env[selection::RequireExactlyOne(generator::Matches( + PackageDepSpec(parse_user_package_dep_spec("=cat/unstable-1", + &env, { })), make_null_shared_ptr(), { }))]->begin()); + const std::shared_ptr<const PackageID> missing1(*env[selection::RequireExactlyOne(generator::Matches( + PackageDepSpec(parse_user_package_dep_spec("=cat/missing-1", + &env, { })), make_null_shared_ptr(), { }))]->begin()); + + test_choice(stable1, "notstmask", false, false, false); + test_choice(stable1, "notpkgstmask", false, false, false); + test_choice(stable1, "notstforce", false, false, false); + test_choice(stable1, "notpkgstforce", false, false, false); + + test_choice(stable1, "stmask", false, false, ! accept_unstable); + test_choice(stable1, "pkgstmask", false, false, ! accept_unstable); + test_choice(stable1, "stforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable1, "pkgstforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + + test_choice(stable1, "mask-stunmask", false, false, accept_unstable); + test_choice(stable1, "unmask-stmask", false, false, ! accept_unstable); + test_choice(stable1, "stmask-pkgunmask", false, false, false); + test_choice(stable1, "stunmask-pkgmask", false, false, true); + test_choice(stable1, "pkgmask-pkgstunmask", false, false, accept_unstable); + test_choice(stable1, "pkgunmask-pkgstmask", false, false, ! accept_unstable); + test_choice(stable1, "pkgstmask-chunmask", false, false, false); + test_choice(stable1, "pkgstunmask-chmask", false, false, true); + test_choice(stable1, "pkgstmask-chpkgstunmask", false, false, false); + test_choice(stable1, "pkgstunmask-chpkgstmask", false, false, ! accept_unstable); + + test_choice(stable1, "force-stunforce", accept_unstable, accept_unstable, accept_unstable); + test_choice(stable1, "unforce-stforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable1, "stforce-pkgunforce", false, false, false); + test_choice(stable1, "stunforce-pkgforce", true, true, true); + test_choice(stable1, "pkgforce-pkgstunforce", accept_unstable, accept_unstable, accept_unstable); + test_choice(stable1, "pkgunforce-pkgstforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable1, "pkgstforce-chunforce", false, false, false); + test_choice(stable1, "pkgstunforce-chforce", true, true, true); + test_choice(stable1, "pkgstforce-chpkgstunforce", false, false, false); + test_choice(stable1, "pkgstunforce-chpkgstforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + + test_choice(stable1r1, "notstmask", false, false, false); + test_choice(stable1r1, "notpkgstmask", false, false, false); + test_choice(stable1r1, "notstforce", false, false, false); + test_choice(stable1r1, "notpkgstforce", false, false, false); + + test_choice(stable1r1, "stmask", false, false, ! accept_unstable); + test_choice(stable1r1, "pkgstmask", false, false, false); + test_choice(stable1r1, "stforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable1r1, "pkgstforce", false, false, false); + + test_choice(stable1r1, "mask-stunmask", false, false, accept_unstable); + test_choice(stable1r1, "unmask-stmask", false, false, ! accept_unstable); + test_choice(stable1r1, "stmask-pkgunmask", false, false, ! accept_unstable); + test_choice(stable1r1, "stunmask-pkgmask", false, false, false); + test_choice(stable1r1, "pkgmask-pkgstunmask", false, false, false); + test_choice(stable1r1, "pkgunmask-pkgstmask", false, false, false); + test_choice(stable1r1, "pkgstmask-chunmask", false, false, false); + test_choice(stable1r1, "pkgstunmask-chmask", false, false, true); + test_choice(stable1r1, "pkgstmask-chpkgstunmask", false, false, ! accept_unstable); + test_choice(stable1r1, "pkgstunmask-chpkgstmask", false, false, false); + + test_choice(stable1r1, "force-stunforce", accept_unstable, accept_unstable, accept_unstable); + test_choice(stable1r1, "unforce-stforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable1r1, "stforce-pkgunforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable1r1, "stunforce-pkgforce", false, false, false); + test_choice(stable1r1, "pkgforce-pkgstunforce", false, false, false); + test_choice(stable1r1, "pkgunforce-pkgstforce", false, false, false); + test_choice(stable1r1, "pkgstforce-chunforce", false, false, false); + test_choice(stable1r1, "pkgstunforce-chforce", true, true, true); + test_choice(stable1r1, "pkgstforce-chpkgstunforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable1r1, "pkgstunforce-chpkgstforce", false, false, false); + + test_choice(stable2, "notstmask", false, false, false); + test_choice(stable2, "notpkgstmask", false, false, false); + test_choice(stable2, "notstforce", false, false, false); + test_choice(stable2, "notpkgstforce", false, false, false); + + test_choice(stable2, "stmask", false, false, ! accept_unstable); + test_choice(stable2, "pkgstmask", false, false, false); + test_choice(stable2, "stforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable2, "pkgstforce", false, false, false); + + test_choice(stable2, "mask-stunmask", false, false, accept_unstable); + test_choice(stable2, "unmask-stmask", false, false, ! accept_unstable); + test_choice(stable2, "stmask-pkgunmask", false, false, ! accept_unstable); + test_choice(stable2, "stunmask-pkgmask", false, false, false); + test_choice(stable2, "pkgmask-pkgstunmask", false, false, false); + test_choice(stable2, "pkgunmask-pkgstmask", false, false, false); + test_choice(stable2, "pkgstmask-chunmask", false, false, false); + test_choice(stable2, "pkgstunmask-chmask", false, false, true); + test_choice(stable2, "pkgstmask-chpkgstunmask", false, false, false); + test_choice(stable2, "pkgstunmask-chpkgstmask", false, false, false); + + test_choice(stable2, "force-stunforce", accept_unstable, accept_unstable, accept_unstable); + test_choice(stable2, "unforce-stforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable2, "stforce-pkgunforce", ! accept_unstable, ! accept_unstable, ! accept_unstable); + test_choice(stable2, "stunforce-pkgforce", false, false, false); + test_choice(stable2, "pkgforce-pkgstunforce", false, false, false); + test_choice(stable2, "pkgunforce-pkgstforce", false, false, false); + test_choice(stable2, "pkgstforce-chunforce", false, false, false); + test_choice(stable2, "pkgstunforce-chforce", true, true, true); + test_choice(stable2, "pkgstforce-chpkgstunforce", false, false, false); + test_choice(stable2, "pkgstunforce-chpkgstforce", false, false, false); + + test_choice(unstable1, "notstmask", false, false, false); + test_choice(unstable1, "notpkgstmask", false, false, false); + test_choice(unstable1, "notstforce", false, false, false); + test_choice(unstable1, "notpkgstforce", false, false, false); + + test_choice(unstable1, "stmask", false, false, false); + test_choice(unstable1, "pkgstmask", false, false, false); + test_choice(unstable1, "stforce", false, false, false); + test_choice(unstable1, "pkgstforce", false, false, false); + + test_choice(unstable1, "mask-stunmask", false, false, true); + test_choice(unstable1, "unmask-stmask", false, false, false); + test_choice(unstable1, "stmask-pkgunmask", false, false, false); + test_choice(unstable1, "stunmask-pkgmask", false, false, false); + test_choice(unstable1, "pkgmask-pkgstunmask", false, false, false); + test_choice(unstable1, "pkgunmask-pkgstmask", false, false, false); + test_choice(unstable1, "pkgstmask-chunmask", false, false, false); + test_choice(unstable1, "pkgstunmask-chmask", false, false, true); + test_choice(unstable1, "pkgstmask-chpkgstunmask", false, false, false); + test_choice(unstable1, "pkgstunmask-chpkgstmask", false, false, false); + + test_choice(unstable1, "force-stunforce", true, true, true); + test_choice(unstable1, "unforce-stforce", false, false, false); + test_choice(unstable1, "stforce-pkgunforce", false, false, false); + test_choice(unstable1, "stunforce-pkgforce", false, false, false); + test_choice(unstable1, "pkgforce-pkgstunforce", false, false, false); + test_choice(unstable1, "pkgunforce-pkgstforce", false, false, false); + test_choice(unstable1, "pkgstforce-chunforce", false, false, false); + test_choice(unstable1, "pkgstunforce-chforce", true, true, true); + test_choice(unstable1, "pkgstforce-chpkgstunforce", false, false, false); + test_choice(unstable1, "pkgstunforce-chpkgstforce", false, false, false); + + test_choice(missing1, "notstmask", false, false, false); + test_choice(missing1, "notpkgstmask", false, false, false); + test_choice(missing1, "notstforce", false, false, false); + test_choice(missing1, "notpkgstforce", false, false, false); + + test_choice(missing1, "stmask", false, false, false); + test_choice(missing1, "pkgstmask", false, false, false); + test_choice(missing1, "stforce", false, false, false); + test_choice(missing1, "pkgstforce", false, false, false); + + test_choice(missing1, "mask-stunmask", false, false, true); + test_choice(missing1, "unmask-stmask", false, false, false); + test_choice(missing1, "stmask-pkgunmask", false, false, false); + test_choice(missing1, "stunmask-pkgmask", false, false, false); + test_choice(missing1, "pkgmask-pkgstunmask", false, false, false); + test_choice(missing1, "pkgunmask-pkgstmask", false, false, false); + test_choice(missing1, "pkgstmask-chunmask", false, false, false); + test_choice(missing1, "pkgstunmask-chmask", false, false, true); + test_choice(missing1, "pkgstmask-chpkgstunmask", false, false, false); + test_choice(missing1, "pkgstunmask-chpkgstmask", false, false, false); + + test_choice(missing1, "force-stunforce", true, true, true); + test_choice(missing1, "unforce-stforce", false, false, false); + test_choice(missing1, "stforce-pkgunforce", false, false, false); + test_choice(missing1, "stunforce-pkgforce", false, false, false); + test_choice(missing1, "pkgforce-pkgstunforce", false, false, false); + test_choice(missing1, "pkgunforce-pkgstforce", false, false, false); + test_choice(missing1, "pkgstforce-chunforce", false, false, false); + test_choice(missing1, "pkgstunforce-chforce", true, true, true); + test_choice(missing1, "pkgstforce-chpkgstunforce", false, false, false); + test_choice(missing1, "pkgstunforce-chpkgstforce", false, false, false); + } + + accept_unstable = ! accept_unstable; + } + while (accept_unstable); +} + TEST(ERepository, Masks) { TestEnvironment env; diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh index 9b24d4a42..6e25e5982 100755 --- a/paludis/repositories/e/e_repository_TEST_setup.sh +++ b/paludis/repositories/e/e_repository_TEST_setup.sh @@ -191,8 +191,7 @@ END cd .. -mkdir -p repo9/{eclass,distfiles,profiles/{profile,child},cat-one/pkg-one,cat-two/pkg-one} || exit 1 -mkdir -p repo9/{cat-one/pkg-one,cat-two/pkg-two} || exit 1 +mkdir -p repo9/{eclass,distfiles,profiles/{profile,child},cat-one/pkg-one,cat-two/pkg-two} || exit 1 cd repo9 || exit 1 echo "test-repo-9" > profiles/repo_name || exit 1 cat <<END >profiles/categories || exit 1 @@ -252,6 +251,125 @@ SLOT="0" END cd .. +mkdir -p repo9a/{eclass,distfiles,profiles/{profile,eapi5,eapi5/child},cat/stable,cat/unstable,cat/missing} || exit 1 +cd repo9a || exit 1 +echo "test-repo-9a" > profiles/repo_name || exit 1 +cat <<END >profiles/categories || exit 1 +cat +END +cat <<END > profiles/arch.list || exit 1 +test +END +cat <<END >profiles/profile/eapi || exit 1 +4 +END +cat <<END >profiles/profile/make.defaults || exit 1 +ARCH=test +END +cat <<END >profiles/profile/use.stable.mask || exit 1 +notstmask +END +cat <<END >profiles/profile/package.use.stable.mask || exit 1 +=cat/stable-1 notpkgstmask +END +cat <<END >profiles/profile/use.stable.force || exit 1 +notstforce +END +cat <<END >profiles/profile/package.use.stable.force || exit 1 +=cat/stable-1 notpkgstforce +END +cat <<END >profiles/eapi5/eapi || exit 1 +5 +END +cat <<END >profiles/eapi5/parent || exit 1 +../profile +END +cat <<END >profiles/eapi5/child/eapi || exit 1 +5 +END +cat <<END >profiles/eapi5/child/parent || exit 1 +.. +END +cat <<END >profiles/eapi5/use.mask || exit 1 +mask-stunmask +-unmask-stmask +END +cat <<END >profiles/eapi5/use.stable.mask || exit 1 +stmask +-mask-stunmask +unmask-stmask +stmask-pkgunmask +-stunmask-pkgmask +END +cat <<END >profiles/eapi5/package.use.mask || exit 1 +=cat/stable-1 -stmask-pkgunmask stunmask-pkgmask +=cat/stable-1 pkgmask-pkgstunmask -pkgunmask-pkgstmask +END +cat <<END >profiles/eapi5/package.use.stable.mask || exit 1 +=cat/stable-1 pkgstmask +=cat/stable-1 -pkgmask-pkgstunmask pkgunmask-pkgstmask +=cat/stable-1 pkgstmask-chunmask -pkgstunmask-chmask +~cat/stable-1 pkgstmask-chpkgstunmask -pkgstunmask-chpkgstmask +END +cat <<END >profiles/eapi5/child/use.mask || exit 1 +-pkgstmask-chunmask +pkgstunmask-chmask +END +cat <<END >profiles/eapi5/child/package.use.stable.mask || exit 1 +=cat/stable-1 -pkgstmask-chpkgstunmask pkgstunmask-chpkgstmask +END +cat <<END >profiles/eapi5/use.force || exit 1 +force-stunforce +-unforce-stforce +END +cat <<END >profiles/eapi5/use.stable.force || exit 1 +stforce +-force-stunforce +unforce-stforce +stforce-pkgunforce +-stunforce-pkgforce +END +cat <<END >profiles/eapi5/package.use.force || exit 1 +=cat/stable-1 -stforce-pkgunforce stunforce-pkgforce +=cat/stable-1 pkgforce-pkgstunforce -pkgunforce-pkgstforce +END +cat <<END >profiles/eapi5/package.use.stable.force || exit 1 +=cat/stable-1 pkgstforce +=cat/stable-1 -pkgforce-pkgstunforce pkgunforce-pkgstforce +=cat/stable-1 pkgstforce-chunforce -pkgstunforce-chforce +~cat/stable-1 pkgstforce-chpkgstunforce -pkgstunforce-chpkgstforce +END +cat <<END >profiles/eapi5/child/use.force || exit 1 +-pkgstforce-chunforce +pkgstunforce-chforce +END +cat <<END >profiles/eapi5/child/package.use.stable.force || exit 1 +=cat/stable-1 -pkgstforce-chpkgstunforce pkgstunforce-chpkgstforce +END +cat <<END > cat/stable/stable-1.ebuild || exit 1 +KEYWORDS="test" +IUSE=" +notstmask notpkgstmask notstforce notpkgstforce +stmask pkgstmask stforce pkgstforce +mask-stunmask unmask-stmask +stmask-pkgunmask stunmask-pkgmask +pkgmask-pkgstunmask pkgunmask-pkgstmask +pkgstmask-chunmask pkgstunmask-chmask +pkgstmask-chpkgstunmask pkgstunmask-chpkgstmask +force-stunforce unforce-stforce +stforce-pkgunforce stunforce-pkgforce +pkgforce-pkgstunforce pkgunforce-pkgstforce +pkgstforce-chunforce pkgstunforce-chforce +pkgstforce-chpkgstunforce pkgstunforce-chpkgstforce +" +SLOT="0" +END +cp cat/stable/stable-{1,1-r1}.ebuild || exit 1 +cp cat/stable/stable-{1,2}.ebuild || exit 1 +sed -e '/KEYWORDS/s/test/~test/' cat/stable/stable-1.ebuild > cat/unstable/unstable-1.ebuild || exit 1 +sed -e '/KEYWORDS/s/test/detest/' cat/stable/stable-1.ebuild > cat/missing/missing-1.ebuild || exit 1 +cd .. + mkdir -p repo10/{eclass,distfiles,profiles/profile/subprofile,cat/masked,cat/not_masked,cat/was_masked} || exit 1 cd repo10 || exit 1 echo "test-repo-10" > profiles/repo_name || exit 1 diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh index 176afa85c..91f21cd74 100644 --- a/paludis/repositories/e/eapi-fwd.hh +++ b/paludis/repositories/e/eapi-fwd.hh @@ -40,6 +40,7 @@ namespace paludis class EAPILabels; class EAPIToolsOptions; class EAPIPipeCommands; + class EAPIProfileOptions; class EAPIChoicesOptions; class EAPIEbuildEnvironmentVariables; class SupportedEAPI; diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc index 28262e90a..09587430f 100644 --- a/paludis/repositories/e/eapi.cc +++ b/paludis/repositories/e/eapi.cc @@ -229,6 +229,13 @@ namespace )); } + std::shared_ptr<const EAPIProfileOptions> make_profile_options(const KeyValueConfigFile & k) + { + return std::make_shared<EAPIProfileOptions>(make_named_values<EAPIProfileOptions>( + n::use_stable_mask_force() = destringify_key<bool>(k, "use_stable_mask_force") + )); + } + std::shared_ptr<const EAPIToolsOptions> make_tool_options(const KeyValueConfigFile & k) { return std::make_shared<EAPIToolsOptions>(make_named_values<EAPIToolsOptions>( @@ -368,6 +375,7 @@ namespace n::package_dep_spec_parse_options() = package_dep_spec_parse_options, n::permitted_directories() = check_get(k, "permitted_directories"), n::pipe_commands() = make_pipe_commands(k), + n::profile_options() = make_profile_options(k), n::tools_options() = make_tool_options(k), n::uri_labels() = std::make_shared<const EAPILabels>(check_get(k, "uri_labels")), n::userpriv_cannot_use_root() = destringify_key<bool>(k, "userpriv_cannot_use_root"), diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh index aeae47f9f..8a87d3285 100644 --- a/paludis/repositories/e/eapi.hh +++ b/paludis/repositories/e/eapi.hh @@ -177,6 +177,7 @@ namespace paludis typedef Name<struct name_permitted_directories> permitted_directories; typedef Name<struct name_pipe_commands> pipe_commands; typedef Name<struct name_profile_iuse_injection> profile_iuse_injection; + typedef Name<struct name_profile_options> profile_options; typedef Name<struct name_properties> properties; typedef Name<struct name_rdepend_defaults_to_depend> rdepend_defaults_to_depend; typedef Name<struct name_remote_ids> remote_ids; @@ -213,6 +214,7 @@ namespace paludis typedef Name<struct name_use_expand> use_expand; typedef Name<struct name_use_expand_hidden> use_expand_hidden; typedef Name<struct name_use_expand_separator> use_expand_separator; + typedef Name<struct name_use_stable_mask_force> use_stable_mask_force; typedef Name<struct name_use_with_enable_empty_third_argument> use_with_enable_empty_third_argument; typedef Name<struct name_userpriv_cannot_use_root> userpriv_cannot_use_root; typedef Name<struct name_utility_path_suffixes> utility_path_suffixes; @@ -309,6 +311,7 @@ namespace paludis NamedValue<n::package_dep_spec_parse_options, ELikePackageDepSpecOptions> package_dep_spec_parse_options; NamedValue<n::permitted_directories, std::string> permitted_directories; NamedValue<n::pipe_commands, std::shared_ptr<const EAPIPipeCommands> > pipe_commands; + NamedValue<n::profile_options, std::shared_ptr<const EAPIProfileOptions> > profile_options; NamedValue<n::tools_options, std::shared_ptr<const EAPIToolsOptions> > tools_options; NamedValue<n::uri_labels, std::shared_ptr<const EAPILabels> > uri_labels; NamedValue<n::userpriv_cannot_use_root, bool> userpriv_cannot_use_root; @@ -461,6 +464,11 @@ namespace paludis NamedValue<n::ebuild_variable, std::string> ebuild_variable; }; + struct EAPIProfileOptions + { + NamedValue<n::use_stable_mask_force, bool> use_stable_mask_force; + }; + struct EAPIToolsOptions { NamedValue<n::best_has_version_host_root, bool> best_has_version_host_root; diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf index 92596f91b..7394b8aa4 100644 --- a/paludis/repositories/e/eapis/0.conf +++ b/paludis/repositories/e/eapis/0.conf @@ -268,6 +268,8 @@ restrict_primaryuri = primaryuri pipe_commands_no_slot_or_repo = true +use_stable_mask_force = false + unpack_unrecognised_is_fatal = false unpack_fix_permissions = true doman_lang_filenames = false diff --git a/paludis/repositories/e/eapis/5.conf b/paludis/repositories/e/eapis/5.conf index f46b4c179..d0fc84a45 100644 --- a/paludis/repositories/e/eapis/5.conf +++ b/paludis/repositories/e/eapis/5.conf @@ -13,6 +13,8 @@ dependency_spec_tree_parse_options = ${dependency_spec_tree_parse_options} allow load_modules = ${load_modules} usex +use_stable_mask_force = true + best_has_version_host_root = true econf_extra_options_help_dependent = ${econf_extra_options_help_dependent} disable-silent-rules::--disable-silent-rules diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf index b633a96d1..3a5b6068e 100644 --- a/paludis/repositories/e/eapis/exheres-0.conf +++ b/paludis/repositories/e/eapis/exheres-0.conf @@ -341,6 +341,8 @@ restrict_primaryuri = pipe_commands_no_slot_or_repo = false +use_stable_mask_force = false + unpack_unrecognised_is_fatal = true unpack_fix_permissions = false doman_lang_filenames = true diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf index 4f6b536fb..7182cbaa0 100644 --- a/paludis/repositories/e/eapis/paludis-1.conf +++ b/paludis/repositories/e/eapis/paludis-1.conf @@ -266,6 +266,8 @@ restrict_primaryuri = pipe_commands_no_slot_or_repo = true +use_stable_mask_force = false + unpack_unrecognised_is_fatal = false unpack_fix_permissions = false doman_lang_filenames = true diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc index 2985615ba..9a6916d0a 100644 --- a/paludis/repositories/e/ebuild_id.cc +++ b/paludis/repositories/e/ebuild_id.cc @@ -147,6 +147,7 @@ namespace paludis mutable bool has_non_xml_keys; mutable bool has_xml_keys; mutable bool has_masks; + mutable bool is_stable; const std::shared_ptr<const LiteralMetadataValueKey<FSPath> > fs_location; @@ -201,6 +202,7 @@ namespace paludis has_non_xml_keys(false), has_xml_keys(false), has_masks(false), + is_stable(false), fs_location(make_fs_location(guessed_eapi, f)) { } @@ -604,6 +606,11 @@ namespace char c(*stringify(k).c_str()); return (c != '~') && (c != '-'); } + + KeywordName make_unstable_keyword(const KeywordName & k) + { + return is_stable_keyword(k) ? KeywordName("~" + stringify(k)) : k; + } } void @@ -636,15 +643,23 @@ EbuildID::need_masks_added() const DistributionData::get_instance()->distribution_from_string( _imp->environment->distribution())->concept_keyword(), keywords_key()->raw_name())); } - else if (keywords->end() == std::find_if(keywords->begin(), keywords->end(), &is_stable_keyword)) + else { - add_overridden_mask(std::make_shared<OverriddenMask>( - make_named_values<OverriddenMask>( - n::mask() = create_e_unaccepted_mask('~', - DistributionData::get_instance()->distribution_from_string( - _imp->environment->distribution())->concept_keyword() + " (unstable accepted)", keywords_key()->raw_name()), - n::override_reason() = mro_accepted_unstable - ))); + auto unstable_keywords(std::make_shared<KeywordNameSet>()); + std::transform(keywords->begin(), keywords->end(), unstable_keywords->inserter(), &make_unstable_keyword); + if (! _imp->environment->accept_keywords(unstable_keywords, shared_from_this())) + _imp->is_stable = true; + + if (keywords->end() == std::find_if(keywords->begin(), keywords->end(), &is_stable_keyword)) + { + add_overridden_mask(std::make_shared<OverriddenMask>( + make_named_values<OverriddenMask>( + n::mask() = create_e_unaccepted_mask('~', + DistributionData::get_instance()->distribution_from_string( + _imp->environment->distribution())->concept_keyword() + " (unstable accepted)", keywords_key()->raw_name()), + n::override_reason() = mro_accepted_unstable + ))); + } } } @@ -1747,6 +1762,13 @@ EbuildID::might_be_binary() const } bool +EbuildID::is_stable() const +{ + need_masks_added(); + return _imp->is_stable; +} + +bool EbuildID::is_installed() const { return false; diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh index 97036a5bd..645c5f680 100644 --- a/paludis/repositories/e/ebuild_id.hh +++ b/paludis/repositories/e/ebuild_id.hh @@ -169,6 +169,7 @@ namespace paludis virtual void purge_invalid_cache() const; bool might_be_binary() const; + bool is_stable() const; virtual void set_scm_revision(const std::string &) const; diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc index 2526c88d7..67d23c0f9 100644 --- a/paludis/repositories/e/exheres_profile.cc +++ b/paludis/repositories/e/exheres_profile.cc @@ -222,7 +222,7 @@ ExheresProfile::profiles_with_parents() const bool ExheresProfile::use_masked( - const std::shared_ptr<const PackageID> & id, + const std::shared_ptr<const EbuildID> & id, const std::shared_ptr<const Choice> & choice, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & @@ -235,7 +235,7 @@ ExheresProfile::use_masked( bool ExheresProfile::use_forced( - const std::shared_ptr<const PackageID> & id, + const std::shared_ptr<const EbuildID> & id, const std::shared_ptr<const Choice> & choice, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & diff --git a/paludis/repositories/e/exheres_profile.hh b/paludis/repositories/e/exheres_profile.hh index f2b0f7bc2..acf11c345 100644 --- a/paludis/repositories/e/exheres_profile.hh +++ b/paludis/repositories/e/exheres_profile.hh @@ -54,14 +54,14 @@ namespace paludis PALUDIS_ATTRIBUTE((warn_unused_result)); virtual bool use_masked( - const std::shared_ptr<const PackageID> &, + const std::shared_ptr<const EbuildID> &, const std::shared_ptr<const Choice> &, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed ) const PALUDIS_ATTRIBUTE((warn_unused_result)); virtual bool use_forced( - const std::shared_ptr<const PackageID> &, + const std::shared_ptr<const EbuildID> &, const std::shared_ptr<const Choice> &, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed diff --git a/paludis/repositories/e/profile.hh b/paludis/repositories/e/profile.hh index 8f2c60edf..a58702be8 100644 --- a/paludis/repositories/e/profile.hh +++ b/paludis/repositories/e/profile.hh @@ -32,7 +32,7 @@ #include <paludis/util/wrapped_forward_iterator-fwd.hh> #include <paludis/util/map-fwd.hh> #include <paludis/util/singleton.hh> -#include <paludis/repositories/e/e_repository_id.hh> +#include <paludis/repositories/e/ebuild_id.hh> #include <paludis/repositories/e/mask_info.hh> #include <string> #include <functional> @@ -54,14 +54,14 @@ namespace paludis PALUDIS_ATTRIBUTE((warn_unused_result)) = 0; virtual bool use_masked( - const std::shared_ptr<const PackageID> &, + const std::shared_ptr<const EbuildID> &, const std::shared_ptr<const Choice> &, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed ) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0; virtual bool use_forced( - const std::shared_ptr<const PackageID> &, + const std::shared_ptr<const EbuildID> &, const std::shared_ptr<const Choice> &, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc index 58147883c..8d857ce1b 100644 --- a/paludis/repositories/e/traditional_profile.cc +++ b/paludis/repositories/e/traditional_profile.cc @@ -82,10 +82,14 @@ namespace std::string origin; FlagStatusMap use_mask; + FlagStatusMap use_stable_mask; FlagStatusMap use_force; + FlagStatusMap use_stable_force; PackageFlagStatusMapList package_use; PackageFlagStatusMapList package_use_mask; + PackageFlagStatusMapList package_use_stable_mask; PackageFlagStatusMapList package_use_force; + PackageFlagStatusMapList package_use_stable_force; StackedValues(const std::string & o) : origin(o) @@ -225,6 +229,13 @@ namespace load_spec_use_file(*eapi, dir / "package.use", _imp->stacked_values_list.back().package_use); load_spec_use_file(*eapi, dir / "package.use.mask", _imp->stacked_values_list.back().package_use_mask); load_spec_use_file(*eapi, dir / "package.use.force", _imp->stacked_values_list.back().package_use_force); + if (eapi->supported()->profile_options()->use_stable_mask_force()) + { + load_basic_use_file(dir / "use.stable.mask", _imp->stacked_values_list.back().use_stable_mask); + load_basic_use_file(dir / "use.stable.force", _imp->stacked_values_list.back().use_stable_force); + load_spec_use_file(*eapi, dir / "package.use.stable.mask", _imp->stacked_values_list.back().package_use_stable_mask); + load_spec_use_file(*eapi, dir / "package.use.stable.force", _imp->stacked_values_list.back().package_use_stable_force); + } _imp->packages_file.add_file(dir / "packages"); _imp->package_mask_file.add_file(dir / "package.mask"); @@ -792,7 +803,7 @@ TraditionalProfile::profiles_with_parents() const bool TraditionalProfile::use_masked( - const std::shared_ptr<const PackageID> & id, + const std::shared_ptr<const EbuildID> & id, const std::shared_ptr<const Choice> & choice, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed @@ -810,6 +821,13 @@ TraditionalProfile::use_masked( if (i->use_mask.end() != f) result = f->second; + if (id->is_stable()) + { + FlagStatusMap::const_iterator fs(i->use_stable_mask.find(value_prefixed)); + if (i->use_stable_mask.end() != fs) + result = fs->second; + } + for (PackageFlagStatusMapList::const_iterator g(i->package_use_mask.begin()), g_end(i->package_use_mask.end()) ; g != g_end ; ++g) { @@ -820,6 +838,20 @@ TraditionalProfile::use_masked( if (g->second.end() != h) result = h->second; } + + if (id->is_stable()) + { + for (PackageFlagStatusMapList::const_iterator gs(i->package_use_stable_mask.begin()), + gs_end(i->package_use_stable_mask.end()) ; gs != gs_end ; ++gs) + { + if (! match_package(*_imp->env, *gs->first, id, make_null_shared_ptr(), { })) + continue; + + FlagStatusMap::const_iterator hs(gs->second.find(value_prefixed)); + if (gs->second.end() != hs) + result = hs->second; + } + } } return result; @@ -827,7 +859,7 @@ TraditionalProfile::use_masked( bool TraditionalProfile::use_forced( - const std::shared_ptr<const PackageID> & id, + const std::shared_ptr<const EbuildID> & id, const std::shared_ptr<const Choice> & choice, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed @@ -846,6 +878,13 @@ TraditionalProfile::use_forced( if (i->use_force.end() != f) result = f->second; + if (id->is_stable()) + { + FlagStatusMap::const_iterator fs(i->use_stable_force.find(value_prefixed)); + if (i->use_stable_force.end() != fs) + result = fs->second; + } + for (PackageFlagStatusMapList::const_iterator g(i->package_use_force.begin()), g_end(i->package_use_force.end()) ; g != g_end ; ++g) { @@ -856,6 +895,20 @@ TraditionalProfile::use_forced( if (g->second.end() != h) result = h->second; } + + if (id->is_stable()) + { + for (PackageFlagStatusMapList::const_iterator gs(i->package_use_stable_force.begin()), + gs_end(i->package_use_stable_force.end()) ; gs != gs_end ; ++gs) + { + if (! match_package(*_imp->env, *gs->first, id, make_null_shared_ptr(), { })) + continue; + + FlagStatusMap::const_iterator hs(gs->second.find(value_prefixed)); + if (gs->second.end() != hs) + result = hs->second; + } + } } return result; diff --git a/paludis/repositories/e/traditional_profile.hh b/paludis/repositories/e/traditional_profile.hh index b3d244672..600559012 100644 --- a/paludis/repositories/e/traditional_profile.hh +++ b/paludis/repositories/e/traditional_profile.hh @@ -53,14 +53,14 @@ namespace paludis PALUDIS_ATTRIBUTE((warn_unused_result)); virtual bool use_masked( - const std::shared_ptr<const PackageID> &, + const std::shared_ptr<const EbuildID> &, const std::shared_ptr<const Choice> &, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed ) const PALUDIS_ATTRIBUTE((warn_unused_result)); virtual bool use_forced( - const std::shared_ptr<const PackageID> &, + const std::shared_ptr<const EbuildID> &, const std::shared_ptr<const Choice> &, const UnprefixedChoiceName & value_unprefixed, const ChoiceNameWithPrefix & value_prefixed |