aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-29 13:36:33 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-29 13:42:02 +0100
commit6bc7de7a08d4a54399b13bd03111728ed6d38c0c (patch)
tree2cb2767a367129e2f9b2feff5be9f284a8ec375c
parent94c0830a85c4f524231f0a61349190cd6811c586 (diff)
downloadpaludis-6bc7de7a08d4a54399b13bd03111728ed6d38c0c.tar.gz
paludis-6bc7de7a08d4a54399b13bd03111728ed6d38c0c.tar.xz
Uninstall unused packages after ex-dependents
-rw-r--r--paludis/resolver/orderer.cc24
-rw-r--r--paludis/resolver/resolver_TEST_purges.cc2
2 files changed, 24 insertions, 2 deletions
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 009ca26..472efb2 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -387,8 +387,30 @@ namespace
{
}
- void visit(const WasUsedByReason &)
+ void visit(const WasUsedByReason & r)
{
+ for (ChangeByResolventSequence::ConstIterator i(r.ids_and_resolvents_being_removed()->begin()),
+ i_end(r.ids_and_resolvents_being_removed()->end()) ;
+ i != i_end ; ++i)
+ {
+ NAGIndex to(make_named_values<NAGIndex>(
+ n::resolvent() = i->resolvent(),
+ n::role() = nir_done
+ ));
+
+ NAGIndex from(make_named_values<NAGIndex>(
+ n::resolvent() = resolvent,
+ n::role() = nir_done
+ ));
+
+ nag->add_edge(from, to,
+ make_named_values<NAGEdgeProperties>(
+ n::build() = false,
+ n::build_all_met() = true,
+ n::run() = false,
+ n::run_all_met() = true
+ ));
+ }
}
};
diff --git a/paludis/resolver/resolver_TEST_purges.cc b/paludis/resolver/resolver_TEST_purges.cc
index 1cc4909..03994e6 100644
--- a/paludis/resolver/resolver_TEST_purges.cc
+++ b/paludis/resolver/resolver_TEST_purges.cc
@@ -107,8 +107,8 @@ namespace test_cases
check_resolved(resolved,
n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
.change(QualifiedPackageName("purges/new-dep"))
- .remove(QualifiedPackageName("purges/old-dep"))
.change(QualifiedPackageName("purges/target"))
+ .remove(QualifiedPackageName("purges/old-dep"))
.finished()),
n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
.finished()),