summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2009-06-04 08:15:07 -0700
committerDaniel Burrows <dburrows@debian.org>2009-06-04 08:15:07 -0700
commitea58374ba9bb30ab909e78ed84d3c4fd4330acac (patch)
tree6cbaa2fde0836726ad7c018b6acb60809c222a06
parentc5649299b22be95da5d4606cd8d73282abf57fe5 (diff)
downloadaptitude-ea58374ba9bb30ab909e78ed84d3c4fd4330acac.tar.gz
When applying an incipient promotion, use the promotions's choice rather than any choice from a solver.
This should be what we do anyway: the promotion's choice will always be the most general one that covers all the solvers that hit it. However, the fact that the previous code wasn't working exposes a bug in contains(): although deps are no longer significant, it's claiming that one choice with a dep doesn't contain another choice with a different dep, even if neither is a from-dep-source choice and they install the same version! That will be fixed momentarily.
-rw-r--r--src/generic/problemresolver/problemresolver.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/generic/problemresolver/problemresolver.h b/src/generic/problemresolver/problemresolver.h
index 574fc192..6aa43a17 100644
--- a/src/generic/problemresolver/problemresolver.h
+++ b/src/generic/problemresolver/problemresolver.h
@@ -1253,9 +1253,8 @@ private:
*/
int solver_hits;
- /** \brief Set to the first choice in the solver set that the
- * promotion hit; if we later get a more general solver, we
- * update this member.
+ /** \brief Set to the first choice in the promotion that was
+ * mapped to a solver.
*
* We only need to store one because there will only be a single
* choice stored as a solver in steps that contain all but one
@@ -1280,12 +1279,15 @@ private:
{
std::map<int, incipient_promotion_search_info> &output;
std::set<int> &visited_solver_steps;
+ const choice &promotion_c;
public:
update_incipient_promotion_information(std::map<int, incipient_promotion_search_info> &_output,
- std::set<int> &_visited_solver_steps)
+ std::set<int> &_visited_solver_steps,
+ const choice &_promotion_c)
: output(_output),
- visited_solver_steps(_visited_solver_steps)
+ visited_solver_steps(_visited_solver_steps),
+ promotion_c(_promotion_c)
{
}
@@ -1307,19 +1309,11 @@ private:
!visited_solver_steps.insert(step_num).second;
if(already_visited)
- {
- // If this is more general than the currently stored
- // solver, replace that solver with this one. (this
- // handles things like hitting a from-dep-source
- // solver first, then another solver later)
- if(c.contains(output_inf.solver))
- output_inf.solver = c;
- return true;
- }
+ return true;
}
++output_inf.solver_hits;
- output_inf.solver = c;
+ output_inf.solver = promotion_c;
break;
}
@@ -1350,7 +1344,7 @@ private:
{
std::set<int> steps_containing_c_as_a_solver;
update_incipient_promotion_information
- update_f(output, steps_containing_c_as_a_solver);
+ update_f(output, steps_containing_c_as_a_solver, c);
graph.for_each_step_related_to_choice(c, update_f);