aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 12:57:04 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 12:57:04 +0100
commit5a6f4f506d67f4c0a347e3e806960edfb4a1417e (patch)
tree282099511629c840a8adcf69a4fab8a6677dfa0f
parent590ce9af177e5f901e4f3e2eac21b4e59320874d (diff)
downloadpaludis-5a6f4f506d67f4c0a347e3e806960edfb4a1417e.tar.gz
paludis-5a6f4f506d67f4c0a347e3e806960edfb4a1417e.tar.xz
Better used_to_use for purge
Fixes: ticket:929
-rw-r--r--paludis/resolver/decider.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index d55f1b6..c9e339c 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1926,7 +1926,19 @@ Decider::purge()
if (resolution->decision())
continue;
- const std::shared_ptr<const ChangeByResolventSequence> used_to_use(new ChangeByResolventSequence);
+ auto used_to_use(std::make_shared<ChangeByResolventSequence>());
+ {
+ auto i_seq(std::make_shared<PackageIDSequence>());
+ i_seq->push_back(*i);
+ for (auto u(unused->begin()), u_end(unused->end()) ;
+ u != u_end ; ++u)
+ if (! _collect_depped_upon(*u, i_seq)->empty())
+ used_to_use->push_back(make_named_values<ChangeByResolvent>(
+ n::package_id() = *u,
+ n::resolvent() = Resolvent(*u, dt_install_to_slash)
+ ));
+ }
+
const std::shared_ptr<const ConstraintSequence> constraints(_make_constraints_for_purge(resolution, *i, used_to_use));
for (ConstraintSequence::ConstIterator c(constraints->begin()), c_end(constraints->end()) ;
c != c_end ; ++c)