aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-11 16:08:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-12 17:51:32 +0000
commit87f29afaa3af247218b283c721bb7a2aeb4bbc07 (patch)
tree1e21159fd82ba57fc815e6667aac9612fbc0e3fd /src
parent7704ad228a1249b4a92961ccca117f0d68f4f36e (diff)
downloadpaludis-87f29afaa3af247218b283c721bb7a2aeb4bbc07.tar.gz
paludis-87f29afaa3af247218b283c721bb7a2aeb4bbc07.tar.xz
cave resolve --no-restarts-for
Diffstat (limited to 'src')
-rw-r--r--src/clients/cave/resolve_cmdline.cc3
-rw-r--r--src/clients/cave/resolve_cmdline.hh3
-rw-r--r--src/clients/cave/resolve_common.cc8
3 files changed, 13 insertions, 1 deletions
diff --git a/src/clients/cave/resolve_cmdline.cc b/src/clients/cave/resolve_cmdline.cc
index c255b57e3..8a5ae041a 100644
--- a/src/clients/cave/resolve_cmdline.cc
+++ b/src/clients/cave/resolve_cmdline.cc
@@ -82,6 +82,9 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
"If otherwise unable to make a decision, unless this option is specified the resolver "
"will try selecting packages using different options to the ones specified in the user's "
"configuration.", true),
+ a_no_restarts_for(&g_resolution_options, "no-restarts-for", '\0',
+ "Do not restart if the problematic package has the specified package name. May be specified "
+ "multiple times. Use '*/*' to avoid all restarts."),
g_dependent_options(this, "Dependent Options", "Dependent options. A package is dependent if it "
"requires (or looks like it might require) a package which is being removed. By default, "
diff --git a/src/clients/cave/resolve_cmdline.hh b/src/clients/cave/resolve_cmdline.hh
index a25b447a5..082e56145 100644
--- a/src/clients/cave/resolve_cmdline.hh
+++ b/src/clients/cave/resolve_cmdline.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -50,6 +50,7 @@ namespace paludis
args::StringSetArg a_purge;
args::SwitchArg a_no_override_masks;
args::SwitchArg a_no_override_flags;
+ args::StringSetArg a_no_restarts_for;
args::ArgsGroup g_dependent_options;
args::StringSetArg a_uninstalls_may_break;
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 37257b382..747305b1c 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -70,6 +70,7 @@
#include <paludis/resolver/allow_choice_changes_helper.hh>
#include <paludis/resolver/allowed_to_remove_helper.hh>
+#include <paludis/resolver/allowed_to_restart_helper.hh>
#include <paludis/resolver/always_via_binary_helper.hh>
#include <paludis/resolver/can_use_helper.hh>
#include <paludis/resolver/confirm_helper.hh>
@@ -723,6 +724,12 @@ paludis::cave::resolve_common(
i != i_end ; ++i)
allowed_to_remove_helper.add_allowed_to_remove_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
+ AllowedToRestartHelper allowed_to_restart_helper(env.get());
+ for (args::StringSetArg::ConstIterator i(resolution_options.a_no_restarts_for.begin_args()),
+ i_end(resolution_options.a_no_restarts_for.end_args()) ;
+ i != i_end ; ++i)
+ allowed_to_restart_helper.add_no_restarts_for_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
+
AlwaysViaBinaryHelper always_via_binary_helper(env.get());
for (args::StringSetArg::ConstIterator i(resolution_options.a_via_binary.begin_args()),
i_end(resolution_options.a_via_binary.end_args()) ;
@@ -1020,6 +1027,7 @@ paludis::cave::resolve_common(
ResolverFunctions resolver_functions(make_named_values<ResolverFunctions>(
n::allow_choice_changes_fn() = std::cref(allow_choice_changes_helper),
n::allowed_to_remove_fn() = std::cref(allowed_to_remove_helper),
+ n::allowed_to_restart_fn() = std::cref(allowed_to_restart_helper),
n::always_via_binary_fn() = std::cref(always_via_binary_helper),
n::can_use_fn() = std::cref(can_use_helper),
n::confirm_fn() = std::cref(confirm_helper),