aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2012-03-03 01:54:43 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2012-03-03 19:57:20 +0000
commit5829b590fdf995a2d584166d6e2c67ee8849b8be (patch)
tree9a5fd8ec0895b6209991aefdee5adf66b2fef250
parent5ccbc4e8a9ef61c77ea4e891391cb8b0f4fe060a (diff)
downloadpaludis-5829b590fdf995a2d584166d6e2c67ee8849b8be.tar.gz
paludis-5829b590fdf995a2d584166d6e2c67ee8849b8be.tar.xz
Disable self-blockers for Gentoo EAPIs
Apparently required by PMS, and also works around Portage rewriting blockers into self-blockers in the VDB when a pkgmoved package includes a blocker on its old name.
-rw-r--r--paludis/repositories/e/dep_parser.cc11
-rw-r--r--paludis/repositories/e/dep_parser.se1
-rw-r--r--paludis/repositories/e/eapis/0.conf2
-rw-r--r--paludis/repositories/e/eapis/2.conf2
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc169
-rwxr-xr-xpaludis/resolver/resolver_TEST_blockers_setup.sh82
6 files changed, 176 insertions, 91 deletions
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 29e0686..f0bde43 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -426,7 +426,7 @@ namespace
}
void add_synthetic_block_annotations(
- const EAPI &,
+ const EAPI & eapi,
const std::shared_ptr<BlockDepSpec> & block_spec,
const BlockFixOp & block_fix_op)
{
@@ -434,7 +434,16 @@ namespace
if (block_spec->maybe_annotations())
std::for_each(block_spec->maybe_annotations()->begin(), block_spec->maybe_annotations()->end(),
std::bind(&DepSpecAnnotations::add, annotations, std::placeholders::_1));
+
add_block_annotations(annotations, block_fix_op);
+ if (eapi.supported()->dependency_spec_tree_parse_options()[dstpo_no_self_block])
+ annotations->add(make_named_values<DepSpecAnnotation>(
+ n::key() = "<match_package>",
+ n::kind() = dsak_synthetic,
+ n::role() = dsar_no_self_match,
+ n::value() = "<no_self_block>"
+ ));
+
block_spec->set_annotations(annotations);
}
diff --git a/paludis/repositories/e/dep_parser.se b/paludis/repositories/e/dep_parser.se
index 25df525..132aa7c 100644
--- a/paludis/repositories/e/dep_parser.se
+++ b/paludis/repositories/e/dep_parser.se
@@ -11,5 +11,6 @@ make_enum_DependencySpecTreeParseOption()
key dstpo_uri_supports_arrow "Allow -> in FetchableURIDepSpec"
key dstpo_double_bang_blocks "Allow both !block and !!block"
key dstpo_single_bang_block_is_hard "!block is a hard block"
+ key dstpo_no_self_block "Blockers never block the containing package"
}
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 1c6d319..56623c1 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -6,7 +6,7 @@ can_be_pbin = true
is_pbin = false
package_dep_spec_parse_options =
-dependency_spec_tree_parse_options =
+dependency_spec_tree_parse_options = no_self_block
iuse_flag_parse_options =
version_spec_options =
merger_options = rewrite_symlinks allow_empty_dirs
diff --git a/paludis/repositories/e/eapis/2.conf b/paludis/repositories/e/eapis/2.conf
index 37a7385..6b7ab9e 100644
--- a/paludis/repositories/e/eapis/2.conf
+++ b/paludis/repositories/e/eapis/2.conf
@@ -7,7 +7,7 @@ can_be_pbin = true
is_pbin = false
package_dep_spec_parse_options = allow_slot_deps allow_use_deps_portage
-dependency_spec_tree_parse_options = uri_supports_arrow double_bang_blocks
+dependency_spec_tree_parse_options = ${dependency_spec_tree_parse_options} uri_supports_arrow double_bang_blocks
ebuild_module_suffixes = 2 1 0
ebuild_functions = ${ebuild_functions} src_prepare src_configure
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index a09d85e..fa319b5 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -339,126 +339,165 @@ TEST_F(ResolverBlockers0TestCase, HardBlockAndDepCycle)
namespace
{
- template <int installed_version_, int dep_version_, bool strong_>
+ template <bool exheres_, int installed_version_, int dep_version_, bool strong_>
struct SelfBlockTestCase :
- ResolverBlockers0TestCase
+ std::conditional<exheres_, ResolverBlockersTestCase, ResolverBlockers0TestCase>::type
{
void common_test_code()
{
std::string cat(std::string("self-block-") +
+ (exheres_ ? "ex" : "eb") + "-" +
(-1 == installed_version_ ? "x" : stringify(installed_version_)) + "-" +
(-1 == dep_version_ ? "x" : stringify(dep_version_)) + "-" +
(strong_ ? "s" : "w"));
if (installed_version_ != -1)
- data->install(cat, "dep", stringify(installed_version_));
+ this->data->install(cat, "dep", stringify(installed_version_));
- data->allowed_to_remove_helper.add_allowed_to_remove_spec(parse_user_package_dep_spec(stringify(cat) + "/dep", &data->env, UserPackageDepSpecOptions()));
+ this->data->allowed_to_remove_helper.add_allowed_to_remove_spec(parse_user_package_dep_spec(stringify(cat) + "/dep", &this->data->env, UserPackageDepSpecOptions()));
- std::shared_ptr<const Resolved> resolved(data->get_resolved(cat + "/target"));
- std::shared_ptr<DecisionChecks> checks, u_checks, o_checks;
+ std::shared_ptr<const Resolved> resolved(this->data->get_resolved(cat + "/target"));
+ std::shared_ptr<ResolverTestCase::DecisionChecks> checks, u_checks, o_checks;
- if (dep_version_ != 0)
+ // dep_version_ != 0 means it blocks itself, but only in exheres
+ if (exheres_ && dep_version_ != 0)
{
- checks = make_shared_copy(DecisionChecks()
+ checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.change(QualifiedPackageName(cat + "/target"))
.finished());
- u_checks = make_shared_copy(DecisionChecks()
+ u_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.unable(QualifiedPackageName(cat + "/dep"))
.finished());
- o_checks = make_shared_copy(DecisionChecks()
+ o_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished());
}
+ // no self-blocker and no already-installed version means no problem
else if (installed_version_ == -1)
{
- checks = make_shared_copy(DecisionChecks()
+ checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.change(QualifiedPackageName(cat + "/dep"))
.change(QualifiedPackageName(cat + "/target"))
.finished());
- u_checks = make_shared_copy(DecisionChecks()
+ u_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished());
- o_checks = make_shared_copy(DecisionChecks()
+ o_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished());
}
- else if (installed_version_ == 1 || ((! strong_) && installed_version_ == 0))
+ // blocker doesn't match the installed version, or blocker is weak, therefore fine
+ else if ((dep_version_ != -1 && dep_version_ != installed_version_) || (! strong_))
{
- checks = make_shared_copy(DecisionChecks()
+ checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.change(QualifiedPackageName(cat + "/dep"))
.change(QualifiedPackageName(cat + "/target"))
.finished());
- u_checks = make_shared_copy(DecisionChecks()
+ u_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished());
- o_checks = make_shared_copy(DecisionChecks()
+ o_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished());
}
- else if (strong_ && installed_version_ == 0 && dep_version_ == 0)
+ // remaining case: strong blocker matches installed version
+ else
{
- checks = make_shared_copy(DecisionChecks()
+ checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.change(QualifiedPackageName(cat + "/target"))
.finished());
- u_checks = make_shared_copy(DecisionChecks()
+ u_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished());
- o_checks = make_shared_copy(DecisionChecks()
+ o_checks = make_shared_copy(ResolverTestCase::DecisionChecks()
.change(QualifiedPackageName(cat + "/dep"))
.finished());
}
- ASSERT_TRUE(bool(checks));
- ASSERT_TRUE(bool(u_checks));
- ASSERT_TRUE(bool(o_checks));
-
check_resolved(resolved,
n::taken_change_or_remove_decisions() = checks,
n::taken_unable_to_make_decisions() = u_checks,
- n::taken_unconfirmed_decisions() = make_shared_copy(DecisionChecks()
+ n::taken_unconfirmed_decisions() = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished()),
n::taken_unorderable_decisions() = o_checks,
- n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ n::untaken_change_or_remove_decisions() = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished()),
- n::untaken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ n::untaken_unable_to_make_decisions() = make_shared_copy(ResolverTestCase::DecisionChecks()
.finished())
);
}
};
}
-typedef SelfBlockTestCase<-1, -1, false> TestSelfBlockXXW;
-typedef SelfBlockTestCase<-1, -1, true> TestSelfBlockXXS;
-typedef SelfBlockTestCase< 0, -1, false> TestSelfBlock0XW;
-typedef SelfBlockTestCase< 0, -1, true> TestSelfBlock0XS;
-typedef SelfBlockTestCase< 1, -1, false> TestSelfBlock1XW;
-typedef SelfBlockTestCase< 1, -1, true> TestSelfBlock1XS;
-typedef SelfBlockTestCase<-1, 0, false> TestSelfBlockX0W;
-typedef SelfBlockTestCase<-1, 0, true> TestSelfBlockX0S;
-typedef SelfBlockTestCase< 0, 0, false> TestSelfBlock00W;
-typedef SelfBlockTestCase< 0, 0, true> TestSelfBlock00S;
-typedef SelfBlockTestCase< 1, 0, false> TestSelfBlock10W;
-typedef SelfBlockTestCase< 1, 0, true> TestSelfBlock10S;
-typedef SelfBlockTestCase<-1, 1, false> TestSelfBlockX1W;
-typedef SelfBlockTestCase<-1, 1, true> TestSelfBlockX1S;
-typedef SelfBlockTestCase< 0, 1, false> TestSelfBlock01W;
-typedef SelfBlockTestCase< 0, 1, true> TestSelfBlock01S;
-typedef SelfBlockTestCase< 1, 1, false> TestSelfBlock11W;
-typedef SelfBlockTestCase< 1, 1, true> TestSelfBlock11S;
-
-TEST_F(TestSelfBlockXXW, Works) { common_test_code(); }
-TEST_F(TestSelfBlockXXS, Works) { common_test_code(); }
-TEST_F(TestSelfBlock0XW, Works) { common_test_code(); }
-TEST_F(TestSelfBlock0XS, Works) { common_test_code(); }
-TEST_F(TestSelfBlock1XW, Works) { common_test_code(); }
-TEST_F(TestSelfBlock1XS, Works) { common_test_code(); }
-TEST_F(TestSelfBlockX0W, Works) { common_test_code(); }
-TEST_F(TestSelfBlockX0S, Works) { common_test_code(); }
-TEST_F(TestSelfBlock00W, Works) { common_test_code(); }
-TEST_F(TestSelfBlock00S, Works) { common_test_code(); }
-TEST_F(TestSelfBlock10W, Works) { common_test_code(); }
-TEST_F(TestSelfBlock10S, Works) { common_test_code(); }
-TEST_F(TestSelfBlockX1W, Works) { common_test_code(); }
-TEST_F(TestSelfBlockX1S, Works) { common_test_code(); }
-TEST_F(TestSelfBlock01W, Works) { common_test_code(); }
-TEST_F(TestSelfBlock01S, Works) { common_test_code(); }
-TEST_F(TestSelfBlock11W, Works) { common_test_code(); }
-TEST_F(TestSelfBlock11S, Works) { common_test_code(); }
+typedef SelfBlockTestCase<false, -1, -1, false> TestSelfBlockEbXXW;
+typedef SelfBlockTestCase<false, -1, -1, true> TestSelfBlockEbXXS;
+typedef SelfBlockTestCase<false, 0, -1, false> TestSelfBlockEb0XW;
+typedef SelfBlockTestCase<false, 0, -1, true> TestSelfBlockEb0XS;
+typedef SelfBlockTestCase<false, 1, -1, false> TestSelfBlockEb1XW;
+typedef SelfBlockTestCase<false, 1, -1, true> TestSelfBlockEb1XS;
+typedef SelfBlockTestCase<false, -1, 0, false> TestSelfBlockEbX0W;
+typedef SelfBlockTestCase<false, -1, 0, true> TestSelfBlockEbX0S;
+typedef SelfBlockTestCase<false, 0, 0, false> TestSelfBlockEb00W;
+typedef SelfBlockTestCase<false, 0, 0, true> TestSelfBlockEb00S;
+typedef SelfBlockTestCase<false, 1, 0, false> TestSelfBlockEb10W;
+typedef SelfBlockTestCase<false, 1, 0, true> TestSelfBlockEb10S;
+typedef SelfBlockTestCase<false, -1, 1, false> TestSelfBlockEbX1W;
+typedef SelfBlockTestCase<false, -1, 1, true> TestSelfBlockEbX1S;
+typedef SelfBlockTestCase<false, 0, 1, false> TestSelfBlockEb01W;
+typedef SelfBlockTestCase<false, 0, 1, true> TestSelfBlockEb01S;
+typedef SelfBlockTestCase<false, 1, 1, false> TestSelfBlockEb11W;
+typedef SelfBlockTestCase<false, 1, 1, true> TestSelfBlockEb11S;
+
+typedef SelfBlockTestCase<true, -1, -1, false> TestSelfBlockExXXW;
+typedef SelfBlockTestCase<true, -1, -1, true> TestSelfBlockExXXS;
+typedef SelfBlockTestCase<true, 0, -1, false> TestSelfBlockEx0XW;
+typedef SelfBlockTestCase<true, 0, -1, true> TestSelfBlockEx0XS;
+typedef SelfBlockTestCase<true, 1, -1, false> TestSelfBlockEx1XW;
+typedef SelfBlockTestCase<true, 1, -1, true> TestSelfBlockEx1XS;
+typedef SelfBlockTestCase<true, -1, 0, false> TestSelfBlockExX0W;
+typedef SelfBlockTestCase<true, -1, 0, true> TestSelfBlockExX0S;
+typedef SelfBlockTestCase<true, 0, 0, false> TestSelfBlockEx00W;
+typedef SelfBlockTestCase<true, 0, 0, true> TestSelfBlockEx00S;
+typedef SelfBlockTestCase<true, 1, 0, false> TestSelfBlockEx10W;
+typedef SelfBlockTestCase<true, 1, 0, true> TestSelfBlockEx10S;
+typedef SelfBlockTestCase<true, -1, 1, false> TestSelfBlockExX1W;
+typedef SelfBlockTestCase<true, -1, 1, true> TestSelfBlockExX1S;
+typedef SelfBlockTestCase<true, 0, 1, false> TestSelfBlockEx01W;
+typedef SelfBlockTestCase<true, 0, 1, true> TestSelfBlockEx01S;
+typedef SelfBlockTestCase<true, 1, 1, false> TestSelfBlockEx11W;
+typedef SelfBlockTestCase<true, 1, 1, true> TestSelfBlockEx11S;
+
+TEST_F(TestSelfBlockEbXXW, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEbXXS, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb0XW, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb0XS, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb1XW, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb1XS, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEbX0W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEbX0S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb00W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb00S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb10W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb10S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEbX1W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEbX1S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb01W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb01S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb11W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEb11S, Works) { common_test_code(); }
+
+TEST_F(TestSelfBlockExXXW, Works) { common_test_code(); }
+TEST_F(TestSelfBlockExXXS, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx0XW, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx0XS, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx1XW, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx1XS, Works) { common_test_code(); }
+TEST_F(TestSelfBlockExX0W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockExX0S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx00W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx00S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx10W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx10S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockExX1W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockExX1S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx01W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx01S, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx11W, Works) { common_test_code(); }
+TEST_F(TestSelfBlockEx11S, Works) { common_test_code(); }
TEST_F(ResolverBlockersTestCase, UninstallBlockedAfter)
{
diff --git a/paludis/resolver/resolver_TEST_blockers_setup.sh b/paludis/resolver/resolver_TEST_blockers_setup.sh
index 47e8c30..01465d7 100755
--- a/paludis/resolver/resolver_TEST_blockers_setup.sh
+++ b/paludis/resolver/resolver_TEST_blockers_setup.sh
@@ -164,27 +164,41 @@ DEPEND="
END
# self-block
-for i in "x" "0" "1" ; do
- for d in "x" "0" "1" ; do
- for b in "w" "s" ; do
- cat=self-block-${i}-${d}-${b}
-
- dep=${cat}/dep
-
- if [[ "${d}" != "x" ]] ; then
- dep="=${dep}-${d}"
- fi
-
- if [[ "${b}" == "w" ]] ; then
- dep="!${dep}"
- else
- dep="!!${dep}"
- fi
-
- echo $cat >> metadata/categories.conf
-
- mkdir -p 'packages/'$cat'/target'
- cat <<END > packages/$cat/target/target-1.ebuild
+for e in "eb" "ex" ; do
+ for i in "x" "0" "1" ; do
+ for d in "x" "0" "1" ; do
+ for b in "w" "s" ; do
+ cat=self-block-${e}-${i}-${d}-${b}
+
+ dep=${cat}/dep
+
+ if [[ "${d}" != "x" ]] ; then
+ if [[ "${e}" == "eb" ]] ; then
+ dep="=${dep}-${d}"
+ else
+ dep="${dep}[=${d}]"
+ fi
+ fi
+
+ if [[ "${b}" == "w" ]] ; then
+ if [[ "${e}" == "eb" ]] ; then
+ dep="!${dep}"
+ else
+ dep="!${dep} [[ resolution = uninstall-blocked-after ]]"
+ fi
+ else
+ if [[ "${e}" == "eb" ]] ; then
+ dep="!!${dep}"
+ else
+ dep="!${dep}"
+ fi
+ fi
+
+ echo $cat >> metadata/categories.conf
+
+ mkdir -p 'packages/'$cat'/target'
+ if [[ "${e}" == "eb" ]] ; then
+ cat <<END > packages/$cat/target/target-1.ebuild
EAPI="2"
DESCRIPTION="target"
KEYWORDS="test"
@@ -193,9 +207,20 @@ DEPEND="
${cat}/dep
"
END
+ else
+ cat <<END > packages/$cat/target/target-1.exheres-0
+SUMMARY="target"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES="build+run:
+ ${cat}/dep
+ "
+END
+ fi
- mkdir -p 'packages/'$cat'/dep'
- cat <<END > packages/$cat/dep/dep-1.ebuild
+ mkdir -p 'packages/'$cat'/dep'
+ if [[ "${e}" == "eb" ]] ; then
+ cat <<END > packages/$cat/dep/dep-1.ebuild
EAPI="2"
DESCRIPTION="target"
KEYWORDS="test"
@@ -204,7 +229,18 @@ DEPEND="
${dep}
"
END
+ else
+ cat <<END > packages/$cat/dep/dep-1.exheres-0
+SUMMARY="target"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES="build+run:
+ ${dep}
+ "
+END
+ fi
+ done
done
done
done