aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 21:36:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 22:05:31 +0000
commit71238060b3f098780e1455e233a83b0e654362f3 (patch)
treef89fe697fd9497b31094c01b9025848b7159fae0
parentfc338af48d1e121327ce9739508d6a82ad9b6927 (diff)
downloadpaludis-71238060b3f098780e1455e233a83b0e654362f3.tar.gz
paludis-71238060b3f098780e1455e233a83b0e654362f3.tar.xz
--permit-uninstall
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.cc14
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.hh8
-rw-r--r--src/clients/cave/resolve_common.cc6
3 files changed, 19 insertions, 9 deletions
diff --git a/src/clients/cave/cmd_resolve_cmdline.cc b/src/clients/cave/cmd_resolve_cmdline.cc
index d349a3c..ea8a6cf 100644
--- a/src/clients/cave/cmd_resolve_cmdline.cc
+++ b/src/clients/cave/cmd_resolve_cmdline.cc
@@ -52,11 +52,15 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
a_complete(&g_convenience_options, "complete", 'c', "Do all optional work.", true),
a_everything(&g_convenience_options, "everything", 'e', "Do all optional work, and also reinstall", true),
-// g_resolution_options(this, "Resolution Options", "Resolution options."),
-// a_permit_slot_uninstalls(&g_resolution_options, "permit-slot-uninstalls", '\0',
-// "Uninstall slots of packages if they are blocked by other slots of that package", true),
-// a_permit_uninstalls(&g_resolution_options, "permit-uninstalls", '\0',
-// "Uninstall packages that are blocked", true),
+ g_resolution_options(this, "Resolution Options", "Resolution options."),
+// a_permit_older_slot_uninstalls(&g_resolution_options, "permit-older-slot-uninstalls", '\0',
+// "Uninstall slots of packages if they are blocked by other slots of that package "
+// "with a newer version", true),
+ a_permit_uninstall(&g_resolution_options, "permit-uninstall", '\0',
+ "Permit uninstallation of packages matching the supplied specification, e.g. to resolve "
+ "blockers. May be specified multiple times. Use '*/*' to allow all uninstalls, but note "
+ "that the resolver will sometimes come up with extremely bad solutions to fixing blocks "
+ "and may suggest stupid and dangerous uninstalls."),
// a_permit_downgrades(&g_resolution_options, "permit-downgrades", '\0', "Permit downgrades", true),
// a_permit_unsafe_uninstalls(&g_resolution_options, "permit-unsafe-uninstalls", '\0',
// "Permit uninstalls even if the uninstall isn't known to be safe", true),
diff --git a/src/clients/cave/cmd_resolve_cmdline.hh b/src/clients/cave/cmd_resolve_cmdline.hh
index 6cd8b24..4cc80e9 100644
--- a/src/clients/cave/cmd_resolve_cmdline.hh
+++ b/src/clients/cave/cmd_resolve_cmdline.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -41,9 +41,9 @@ namespace paludis
args::SwitchArg a_complete;
args::SwitchArg a_everything;
- // args::ArgsGroup g_resolution_options;
- // args::SwitchArg a_permit_slot_uninstalls;
- // args::SwitchArg a_permit_uninstalls;
+ args::ArgsGroup g_resolution_options;
+ // args::SwitchArg a_permit_older_slot_uninstalls;
+ args::StringSetArg a_permit_uninstall;
// args::SwitchArg a_permit_downgrades;
// args::SwitchArg a_permit_unsafe_uninstalls;
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 0a40a9a..b8db984 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -1179,6 +1179,12 @@ paludis::cave::resolve_common(
InitialConstraints initial_constraints;
PackageDepSpecList allowed_to_remove_specs;
+ for (args::StringSetArg::ConstIterator i(resolution_options.a_permit_uninstall.begin_args()),
+ i_end(resolution_options.a_permit_uninstall.end_args()) ;
+ i != i_end ; ++i)
+ allowed_to_remove_specs.push_back(parse_user_package_dep_spec(*i, env.get(),
+ UserPackageDepSpecOptions() + updso_allow_wildcards));
+
ResolverFunctions resolver_functions(make_named_values<ResolverFunctions>(
value_for<n::allowed_to_remove_fn>(std::tr1::bind(&allowed_to_remove_fn,
env.get(),