aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Dimitry Ishenko <dimitry.ishenko@gmail.com> 2014-03-05 11:23:35 -0500
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2014-03-21 15:36:19 +0000
commit3a35488e4b85c73ad201427b36e114347ad1cf09 (patch)
tree8382b359430cd0f7378728b2329d81b9343d5016
parent4146ff8665112932e5e9cd54f7ed5caf0773e51a (diff)
downloadpaludis-3a35488e4b85c73ad201427b36e114347ad1cf09.tar.gz
paludis-3a35488e4b85c73ad201427b36e114347ad1cf09.tar.xz
Add --promote-binaries option
-rw-r--r--src/clients/cave/resolve_cmdline.cc8
-rw-r--r--src/clients/cave/resolve_cmdline.hh1
-rw-r--r--src/clients/cave/resolve_common.cc7
3 files changed, 16 insertions, 0 deletions
diff --git a/src/clients/cave/resolve_cmdline.cc b/src/clients/cave/resolve_cmdline.cc
index 5ad7fb3..f60c2bd 100644
--- a/src/clients/cave/resolve_cmdline.cc
+++ b/src/clients/cave/resolve_cmdline.cc
@@ -85,6 +85,14 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
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."),
+ a_promote_binaries(&g_resolution_options, "promote-binaries", '\0',
+ "Select when to promote packages from binary repositories",
+ args::EnumArg::EnumArgOptions
+ ("never", 'n', "Never")
+ ("if-same", 's', "If it has the same version and exactly matching use flags"),
+
+ "never"
+ ),
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 ed78765..9631e94 100644
--- a/src/clients/cave/resolve_cmdline.hh
+++ b/src/clients/cave/resolve_cmdline.hh
@@ -51,6 +51,7 @@ namespace paludis
args::SwitchArg a_no_override_masks;
args::SwitchArg a_no_override_flags;
args::StringSetArg a_no_restarts_for;
+ args::EnumArg a_promote_binaries;
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 ce353a2..45a779f 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -1086,6 +1086,13 @@ paludis::cave::resolve_common(
+ resolution_options.a_recommendations.long_name() + "'");
PromoteBinariesHelper promote_binaries_helper(env.get());
+ if (resolution_options.a_promote_binaries.argument() == "never")
+ promote_binaries_helper.set_promote_binaries(pb_never);
+ else if (resolution_options.a_promote_binaries.argument() == "if-same")
+ promote_binaries_helper.set_promote_binaries(pb_if_same);
+ else
+ throw args::DoHelp("Don't understand argument '" + resolution_options.a_promote_binaries.argument() + "' to '--"
+ + resolution_options.a_promote_binaries.long_name() + "'");
ResolverFunctions resolver_functions(make_named_values<ResolverFunctions>(
n::allow_choice_changes_fn() = std::cref(allow_choice_changes_helper),