aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-06 15:52:43 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-06 15:52:43 +0100
commit5c10fa2c48e0163b3f2a2a54b3b46f9aef156d9c (patch)
tree05fa9c342b4edef33eb55400e3ea9a484a7daad6
parent7906a8e39efb157b8b63d8b2b209ccf145370a3a (diff)
downloadpaludis-5c10fa2c48e0163b3f2a2a54b3b46f9aef156d9c.tar.gz
paludis-5c10fa2c48e0163b3f2a2a54b3b46f9aef156d9c.tar.xz
Be less clever with || ( ) selection
Otherwise || ( self already-installed ) leads to an unbreakable cycle. Fixes: ticket:1189
-rw-r--r--paludis/resolver/any_child_score.se1
-rw-r--r--paludis/resolver/decider.cc28
-rw-r--r--paludis/resolver/resolver_TEST_any.cc24
-rwxr-xr-xpaludis/resolver/resolver_TEST_any_setup.sh21
4 files changed, 46 insertions, 28 deletions
diff --git a/paludis/resolver/any_child_score.se b/paludis/resolver/any_child_score.se
index 2b8f041..76700e9 100644
--- a/paludis/resolver/any_child_score.se
+++ b/paludis/resolver/any_child_score.se
@@ -12,7 +12,6 @@ make_enum_AnyChildScore()
key acs_blocks_installed "Blocks a currently-installed package"
key acs_could_install "Could install"
key acs_already_installed "Already installed"
- key acs_will_be_installing "Will be installing"
key acs_vacuous_blocker "Blocker that doesn't match any installable packages"
key acs_prefer "Explicitly preferred"
key acs_better_than_best "Better than the best option"
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index a898cf2..2873dbf 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1259,34 +1259,8 @@ Decider::find_any_score(
const std::shared_ptr<const Resolvents> resolvents_unless_block(is_block ? make_null_shared_ptr() :
_get_resolvents_for(spec, reason_unless_block).first);
- /* next: will already be installing */
- static_assert(acs_will_be_installing < acs_vacuous_blocker, "acs order changed");
- if (! is_block)
- {
- for (Resolvents::ConstIterator r(resolvents_unless_block->begin()), r_end(resolvents_unless_block->end()) ;
- r != r_end ; ++r)
- {
- bool any(false), any_bad(false);
- ResolutionsByResolvent::ConstIterator i(_imp->resolutions_by_resolvent->find(*r));
- if (i != _imp->resolutions_by_resolvent->end() && (*i)->decision())
- {
- auto constraint(_make_constraint_from_package_dependency(our_resolution, dep, reason_unless_block, si_take));
- if (_check_constraint(constraint, (*i)->decision()))
- any = true;
- else
- {
- any_bad = false;
- break;
- }
- }
-
- if (any && ! any_bad)
- return std::make_pair(acs_will_be_installing, operator_bias);
- }
- }
-
/* next: already installed */
- static_assert(acs_already_installed < acs_will_be_installing, "acs order changed");
+ static_assert(acs_already_installed < acs_vacuous_blocker, "acs order changed");
{
Context sub_context("When working out whether it's acs_already_installed:");
diff --git a/paludis/resolver/resolver_TEST_any.cc b/paludis/resolver/resolver_TEST_any.cc
index 2f7c6fe..7242228 100644
--- a/paludis/resolver/resolver_TEST_any.cc
+++ b/paludis/resolver/resolver_TEST_any.cc
@@ -296,3 +296,27 @@ TEST_F(ResolverAnyTestCase, SelfUseNeither)
);
}
+TEST_F(ResolverAnyTestCase, SelfOrOther)
+{
+ data->install("self-or-other", "other", "1");
+ data->get_use_existing_nothing_helper.set_use_existing_for_dependencies(ue_if_same_version);
+
+ std::shared_ptr<const Resolved> resolved(data->get_resolved("self-or-other/target"));
+
+ check_resolved(resolved,
+ n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .change(QualifiedPackageName("self-or-other/target"))
+ .finished()),
+ n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::taken_unconfirmed_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::taken_unorderable_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::untaken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished())
+ );
+}
+
diff --git a/paludis/resolver/resolver_TEST_any_setup.sh b/paludis/resolver/resolver_TEST_any_setup.sh
index 1f56d53..50ec27c 100755
--- a/paludis/resolver/resolver_TEST_any_setup.sh
+++ b/paludis/resolver/resolver_TEST_any_setup.sh
@@ -134,5 +134,26 @@ MYOPTIONS="disabled disabled2"
DEPENDENCIES="run: || ( self-use-neither/dep[disabled] self-use-neither/dep[disabled2] )"
END
+# self-or-other
+echo 'self-or-other' >> metadata/categories.conf
+
+mkdir -p 'packages/self-or-other/target'
+cat <<END > packages/self-or-other/target/target-1.exheres-0
+SUMMARY="target"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES="
+ || ( self-or-other/target self-or-other/other )
+ "
+END
+
+mkdir -p 'packages/self-or-other/other'
+cat <<END > packages/self-or-other/other/other-1.exheres-0
+SUMMARY="other"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES=""
+END
+
cd ..