aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-04 21:10:56 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-04 21:10:56 +0100
commit1b2a9c10febe9212baf92dcefd87f295e45c5219 (patch)
tree6a8ff94d3060198ddc87e54acfec61ab7b36d520
parent7602f5dd93d8d9eb6f37787e7c2a45c7fc01bcc6 (diff)
downloadpaludis-1b2a9c10febe9212baf92dcefd87f295e45c5219.tar.gz
paludis-1b2a9c10febe9212baf92dcefd87f295e45c5219.tar.xz
Try option changes later
-rw-r--r--paludis/resolver/decider.cc20
-rw-r--r--paludis/resolver/decider.hh3
2 files changed, 16 insertions, 7 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 0e81eb1..fa9f8c1 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1076,7 +1076,7 @@ Decider::_made_wrong_decision(
std::shared_ptr<Resolution> adapted_resolution(std::make_shared<Resolution>(*resolution));
adapted_resolution->constraints()->add(constraint);
- const std::shared_ptr<Decision> decision(_try_to_find_decision_for(adapted_resolution, true, false));
+ const std::shared_ptr<Decision> decision(_try_to_find_decision_for(adapted_resolution, true, false, true, false));
if (decision)
{
resolution->decision()->accept(WrongDecisionVisitor(std::bind(
@@ -1143,7 +1143,7 @@ Decider::_decide(const std::shared_ptr<Resolution> & resolution)
_copy_other_destination_constraints(resolution);
- std::shared_ptr<Decision> decision(_try_to_find_decision_for(resolution, true, false));
+ std::shared_ptr<Decision> decision(_try_to_find_decision_for(resolution, true, false, true, false));
if (decision)
resolution->decision() = decision;
else
@@ -1446,7 +1446,7 @@ Decider::find_any_score(
for (ConstraintSequence::ConstIterator c(constraints->begin()), c_end(constraints->end()) ;
c != c_end ; ++c)
resolution->constraints()->add(*c);
- const std::shared_ptr<Decision> decision(_try_to_find_decision_for(resolution, false, false));
+ const std::shared_ptr<Decision> decision(_try_to_find_decision_for(resolution, false, false, false, false));
if (decision)
return std::make_pair(acs_could_install, operator_bias);
}
@@ -1582,6 +1582,8 @@ Decider::_get_error_resolvents_for(
const std::shared_ptr<Decision>
Decider::_try_to_find_decision_for(
const std::shared_ptr<const Resolution> & resolution,
+ const bool also_try_option_changes,
+ const bool try_option_changes_this_time,
const bool also_try_masked,
const bool try_masked_this_time) const
{
@@ -1590,7 +1592,7 @@ Decider::_try_to_find_decision_for(
std::shared_ptr<const PackageID> installable_id;
std::shared_ptr<const ChangedChoices> changed_choices;
bool best;
- std::tie(installable_id, changed_choices, best) = _find_installable_id_for(resolution, try_masked_this_time);
+ std::tie(installable_id, changed_choices, best) = _find_installable_id_for(resolution, try_option_changes_this_time, try_masked_this_time);
if (resolution->constraints()->nothing_is_fine_too())
{
@@ -1664,8 +1666,10 @@ Decider::_try_to_find_decision_for(
_installed_ids(resolution),
! resolution->constraints()->all_untaken()
);
+ else if (also_try_option_changes && ! try_option_changes_this_time)
+ return _try_to_find_decision_for(resolution, true, true, also_try_masked, try_masked_this_time);
else if (also_try_masked && ! try_masked_this_time)
- return _try_to_find_decision_for(resolution, true, true);
+ return _try_to_find_decision_for(resolution, also_try_option_changes, try_option_changes_this_time, true, true);
else
return make_null_shared_ptr();
}
@@ -1867,9 +1871,11 @@ Decider::_find_installable_id_candidates_for(
}
const Decider::FoundID
-Decider::_find_installable_id_for(const std::shared_ptr<const Resolution> & resolution, const bool include_unmaskable) const
+Decider::_find_installable_id_for(const std::shared_ptr<const Resolution> & resolution,
+ const bool include_option_changes,
+ const bool include_unmaskable) const
{
- return _find_id_for_from(resolution, _find_installable_id_candidates_for(resolution, false, include_unmaskable), true, false);
+ return _find_id_for_from(resolution, _find_installable_id_candidates_for(resolution, false, include_unmaskable), include_option_changes, false);
}
const Decider::FoundID
diff --git a/paludis/resolver/decider.hh b/paludis/resolver/decider.hh
index 7356a10..ded7b64 100644
--- a/paludis/resolver/decider.hh
+++ b/paludis/resolver/decider.hh
@@ -186,6 +186,8 @@ namespace paludis
const std::shared_ptr<Decision> _try_to_find_decision_for(
const std::shared_ptr<const Resolution> & resolution,
+ const bool also_try_option_changes,
+ const bool try_option_changes_this_time,
const bool also_try_masked,
const bool try_masked_this_time) const;
@@ -212,6 +214,7 @@ namespace paludis
const bool include_unmaskable) const;
const FoundID _find_installable_id_for(
const std::shared_ptr<const Resolution> &,
+ const bool include_option_changes,
const bool include_unmaskable) const;
const FoundID _find_id_for_from(
const std::shared_ptr<const Resolution> &,