aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-27 11:16:03 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-27 11:16:03 +0000
commita0e1195dccd7250307858abdf4fb0c50f33cf820 (patch)
treefad2c935906e0a7d5e654d18e5aa365bc55a8118
parent8ff185e2ed773de1a031a8f55b6770fe7599b819 (diff)
downloadpaludis-a0e1195dccd7250307858abdf4fb0c50f33cf820.tar.gz
paludis-a0e1195dccd7250307858abdf4fb0c50f33cf820.tar.xz
Don't show virtuals for uninstall-unused
-rw-r--r--paludis/tasks/uninstall_task.cc3
-rw-r--r--paludis/uninstall_list.cc7
-rw-r--r--paludis/uninstall_list.sr1
-rw-r--r--src/paludis/uninstall.cc3
4 files changed, 10 insertions, 4 deletions
diff --git a/paludis/tasks/uninstall_task.cc b/paludis/tasks/uninstall_task.cc
index b01ec51..607bbe5 100644
--- a/paludis/tasks/uninstall_task.cc
+++ b/paludis/tasks/uninstall_task.cc
@@ -196,6 +196,9 @@ UninstallTask::execute()
for (UninstallList::Iterator i(list.begin()), i_end(list.end()) ; i != i_end ; ++i)
{
+ if (i->skip_uninstall)
+ continue;
+
std::string cpvr(stringify(i->package));
_imp->env->perform_hook(Hook("uninstall_pre")("TARGET", cpvr));
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index 5ce3c5b..2acd13c 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -234,11 +234,10 @@ UninstallList::add_package(const PackageDatabaseEntry & e)
{
Context context("When adding package '" + stringify(e) + "' to the uninstall list:");
- if (! _imp->env->package_database()->fetch_repository(e.repository)->has_version(e.name, e.version))
- throw InternalError(PALUDIS_HERE, "Trying to add '" + stringify(e) +
- "' to UninstallList but has_version failed");
+ VersionMetadata::ConstPointer m(_imp->env->package_database()->fetch_repository(
+ e.repository)->version_metadata(e.name, e.version));
- _imp->uninstall_list.push_back(UninstallListEntry(e));
+ _imp->uninstall_list.push_back(UninstallListEntry(e, m->get_virtual_interface()));
}
void
diff --git a/paludis/uninstall_list.sr b/paludis/uninstall_list.sr
index ff83372..940bdf6 100644
--- a/paludis/uninstall_list.sr
+++ b/paludis/uninstall_list.sr
@@ -25,6 +25,7 @@ END
make_class_UninstallListEntry()
{
key package PackageDatabaseEntry
+ key skip_uninstall bool
allow_named_args
diff --git a/src/paludis/uninstall.cc b/src/paludis/uninstall.cc
index 742d0d1..2f7986f 100644
--- a/src/paludis/uninstall.cc
+++ b/src/paludis/uninstall.cc
@@ -76,6 +76,9 @@ namespace
virtual void on_display_unmerge_list_entry(const UninstallListEntry & d)
{
+ if (d.skip_uninstall)
+ return;
+
cout << "* " << colour(cl_package_name, stringify(d.package)) << endl;
++_count;
}