aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-13 05:56:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-13 05:56:54 +0000
commitcbdb4346c06bd7ff410a307a884d3f743c1170e3 (patch)
treefbfff8523b6f315ea3a181a79566c2a699aad112
parente6bd29a36ef60e70ee89eea15a4d09e3f731bbca (diff)
downloadpaludis-cbdb4346c06bd7ff410a307a884d3f743c1170e3.tar.gz
paludis-cbdb4346c06bd7ff410a307a884d3f743c1170e3.tar.xz
The special set 'ununused' can now be used to indicate that a package should be considered 'used' for --uninstall-unused etc.
-rw-r--r--paludis/environment_implementation.cc3
-rw-r--r--paludis/install_task.cc2
-rw-r--r--paludis/uninstall_list.cc14
-rw-r--r--src/output/console_install_task.cc2
4 files changed, 16 insertions, 5 deletions
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 295d622..bc54443 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -101,7 +101,8 @@ EnvironmentImplementation::set(const SetName & s) const
tr1::shared_ptr<ConstTreeSequence<SetSpecTree, AllDepSpec> > result;
/* these sets always exist, even if empty */
- if (s.data() == "everything" || s.data() == "system" || s.data() == "world" || s.data() == "security")
+ if (s.data() == "everything" || s.data() == "system" || s.data() == "world" || s.data() == "security"
+ || s.data() == "ununused")
{
Log::get_instance()->message(ll_debug, lc_context) << "Set '" << s << "' is a standard set";
result.reset(new ConstTreeSequence<SetSpecTree, AllDepSpec>(tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 0fcca73..73f2ec4 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -923,7 +923,7 @@ void
InstallTask::world_update_set(const SetName & s)
{
if (s == SetName("world") || s == SetName("system") || s == SetName("security")
- || s == SetName("everything") || s == SetName("insecurity"))
+ || s == SetName("everything") || s == SetName("insecurity") || s == SetName("ununused"))
{
on_update_world_skip(s, "special sets cannot be added to world");
return;
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index d2b97a7..5d28049 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -416,13 +416,16 @@ UninstallList::add_unused_dependencies()
depped_upon_not_list->begin(), depped_upon_not_list->end(), unused_dependencies->inserter(),
PackageIDSetComparator());
- /* if any of them aren't already on the list, and aren't in world, add them and recurse */
- tr1::shared_ptr<SetSpecTree::ConstItem> world(_imp->env->set(SetName("world")));
+ /* if any of them aren't already on the list, and aren't in world or ununused, add them and recurse */
+ tr1::shared_ptr<SetSpecTree::ConstItem> world(_imp->env->set(SetName("world"))),
+ ununused(_imp->env->set(SetName("ununused")));
for (PackageIDSet::ConstIterator i(unused_dependencies->begin()),
i_end(unused_dependencies->end()) ; i != i_end ; ++i)
{
if (match_package_in_set(*_imp->env, *world, **i))
continue;
+ if (ununused && match_package_in_set(*_imp->env, *ununused, **i))
+ continue;
if (_imp->uninstall_list.end() != std::find_if(_imp->uninstall_list.begin(),
_imp->uninstall_list.end(), MatchUninstallListEntry(*i)))
@@ -494,11 +497,16 @@ UninstallList::collect_world() const
tr1::shared_ptr<PackageIDSet> result(new PackageIDSet);
tr1::shared_ptr<const PackageIDSet> everything(collect_all_installed());
- tr1::shared_ptr<SetSpecTree::ConstItem> world(_imp->env->set(SetName("world")));
+ tr1::shared_ptr<SetSpecTree::ConstItem> world(_imp->env->set(SetName("world"))),
+ ununused(_imp->env->set(SetName("ununused")));
for (PackageIDSet::ConstIterator i(everything->begin()),
i_end(everything->end()) ; i != i_end ; ++i)
+ {
if (match_package_in_set(*_imp->env, *world, **i))
result->insert(*i);
+ else if (ununused && match_package_in_set(*_imp->env, *ununused, **i))
+ result->insert(*i);
+ }
return result;
}
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index cec3afb..992b0fd 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -797,6 +797,8 @@ DepTagSummaryDisplayer::visit(const GeneralSetDepTag & tag)
std::string desc;
if (tag.short_text() == "world")
desc = ": Packages that have been explicitly installed";
+ else if (tag.short_text() == "ununused")
+ desc = ": Packages that have been explicitly marked as not unused";
else if (tag.short_text() == "everything")
desc = ": All installed packages";
else if (tag.short_text() == "system")