aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-29 19:00:49 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-29 19:00:49 +0100
commitdce369ab0bb838a61f7e1df4616a5ef3b051889b (patch)
tree56adeddde6246ad72a23d6cda734004831f9081d
parentec5b581973d0b67e4453af44c29b0a5aba430f74 (diff)
downloadpaludis-dce369ab0bb838a61f7e1df4616a5ef3b051889b.tar.gz
paludis-dce369ab0bb838a61f7e1df4616a5ef3b051889b.tar.xz
Orderer voodoo for weak blocks
-rw-r--r--paludis/resolver/orderer.cc34
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc3
-rwxr-xr-xpaludis/resolver/resolver_TEST_blockers_setup.sh9
3 files changed, 33 insertions, 13 deletions
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 472efb2..a193917 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -310,23 +310,23 @@ namespace
if (classifier.build || classifier.run || classifier.fetch)
{
- bool arrow(true);
+ bool normal(true);
if (r.sanitised_dependency().spec().if_block())
if (! r.sanitised_dependency().spec().if_block()->strong())
- arrow = false;
+ normal = false;
- if (arrow)
- {
- NAGIndex from(make_named_values<NAGIndex>(
- n::resolvent() = r.from_resolvent(),
- n::role() = classifier.fetch ? role_for_fetching(r.from_resolvent()) : nir_done
- ));
+ NAGIndex from(make_named_values<NAGIndex>(
+ n::resolvent() = r.from_resolvent(),
+ n::role() = classifier.fetch ? role_for_fetching(r.from_resolvent()) : nir_done
+ ));
- NAGIndex to(make_named_values<NAGIndex>(
- n::resolvent() = resolvent,
- n::role() = nir_done
- ));
+ NAGIndex to(make_named_values<NAGIndex>(
+ n::resolvent() = resolvent,
+ n::role() = nir_done
+ ));
+ if (normal)
+ {
nag->add_edge(from, to,
make_named_values<NAGEdgeProperties>(
n::build() = classifier.build || classifier.fetch,
@@ -335,6 +335,16 @@ namespace
n::run_all_met() = r.already_met() || ! classifier.run
));
}
+ else
+ {
+ nag->add_edge(to, from,
+ make_named_values<NAGEdgeProperties>(
+ n::build() = false,
+ n::build_all_met() = true,
+ n::run() = false,
+ n::run_all_met() = true
+ ));
+ }
}
else if (classifier.post)
{
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index f8c3b67..90ab1a3 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -142,7 +142,9 @@ namespace test_cases
transient(t)
{
allowed_to_remove_names->insert(QualifiedPackageName("remove/a-pkg"));
+ allowed_to_remove_names->insert(QualifiedPackageName("remove/z-pkg"));
install("remove", "a-pkg", "1")->behaviours_set()->insert(transient ? "transient" : "");
+ install("remove", "z-pkg", "1")->behaviours_set()->insert(transient ? "transient" : "");
}
void run()
@@ -151,6 +153,7 @@ namespace test_cases
check_resolved(resolved,
n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
.remove(QualifiedPackageName("remove/a-pkg"))
+ .remove(QualifiedPackageName("remove/z-pkg"))
.change(QualifiedPackageName("remove/target"))
.finished()),
n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
diff --git a/paludis/resolver/resolver_TEST_blockers_setup.sh b/paludis/resolver/resolver_TEST_blockers_setup.sh
index 47cd67c..51813e4 100755
--- a/paludis/resolver/resolver_TEST_blockers_setup.sh
+++ b/paludis/resolver/resolver_TEST_blockers_setup.sh
@@ -75,7 +75,7 @@ SUMMARY="target"
PLATFORMS="test"
SLOT="0"
DEPENDENCIES="
- ( !remove/a-pkg )
+ ( !remove/a-pkg !remove/z-pkg )
"
END
@@ -86,6 +86,13 @@ PLATFORMS="test"
SLOT="0"
END
+mkdir -p 'packages/remove/z-pkg'
+cat <<END > packages/remove/z-pkg/z-pkg-2.exheres-0
+SUMMARY="dep"
+PLATFORMS="test"
+SLOT="0"
+END
+
# blocked-and-dep
echo 'blocked-and-dep' >> metadata/categories.conf