aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-28 21:21:07 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-28 21:21:07 +0100
commitcc3a464d6a56f5e509c75924c4b5ffc268647d26 (patch)
tree962ae432bc8bbf7fa6d5273a0381b10bd99c5d6d
parent11f679255c1a8c7babc6f2274a60e1582978c77a (diff)
downloadpaludis-cc3a464d6a56f5e509c75924c4b5ffc268647d26.tar.gz
paludis-cc3a464d6a56f5e509c75924c4b5ffc268647d26.tar.xz
Don't purge things in world
Fixes: ticket:899
-rw-r--r--paludis/resolver/decider.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index c213719..03356e6 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1999,6 +1999,8 @@ Decider::_resolve_purges()
std::set_difference(newly_unused->begin(), newly_unused->end(),
used_by_unchanging->begin(), used_by_unchanging->end(), newly_really_unused->inserter(), PackageIDSetComparator());
+ const std::tr1::shared_ptr<const SetSpecTree> world(_imp->env->set(SetName("world")));
+
bool changed(false);
for (PackageIDSet::ConstIterator i(newly_really_unused->begin()), i_end(newly_really_unused->end()) ;
i != i_end ; ++i)
@@ -2009,6 +2011,11 @@ Decider::_resolve_purges()
(*i)->behaviours_key()->value()->find("used"))
continue;
+ /* to catch packages being purged that are also in world and not used
+ * by anything else */
+ if (match_package_in_set(*_imp->env, *world, **i, MatchPackageOptions()))
+ continue;
+
const std::tr1::shared_ptr<PackageIDSequence> used_to_use(new PackageIDSequence), star_i_set(new PackageIDSequence);
star_i_set->push_back(*i);
for (PackageIDSet::ConstIterator g(going_away->begin()), g_end(going_away->end()) ;