aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/paludis/command_line.cc7
-rw-r--r--src/paludis/command_line.hh2
-rw-r--r--src/paludis/install.cc12
3 files changed, 21 insertions, 0 deletions
diff --git a/src/paludis/command_line.cc b/src/paludis/command_line.cc
index 1ffbbc66e..63ac0b8d7 100644
--- a/src/paludis/command_line.cc
+++ b/src/paludis/command_line.cc
@@ -173,6 +173,13 @@ CommandLine::CommandLine() :
("discard", "Discard"),
"error"),
+ dl_fall_back(&dl_args, "dl-fall-back", '\0', "When to fall back to installed packages",
+ paludis::args::EnumArg::EnumArgOptions
+ ("as-needed-except-targets", "Where necessary, but not for target packages")
+ ("as-needed", "Where necessary, including for target packages")
+ ("never", "Never"),
+ "as-needed"),
+
list_args(this, "List options",
"Options relevant for one or more of the --list actions."),
a_repository(&list_args, "repository", '\0', "Matches with this repository name only"),
diff --git a/src/paludis/command_line.hh b/src/paludis/command_line.hh
index ffe7a7329..81d0f8e5c 100644
--- a/src/paludis/command_line.hh
+++ b/src/paludis/command_line.hh
@@ -219,6 +219,8 @@ class CommandLine :
paludis::args::EnumArg dl_circular;
+ paludis::args::EnumArg dl_fall_back;
+
/// }
/// \name List arguments
diff --git a/src/paludis/install.cc b/src/paludis/install.cc
index 99fa9cb33..1939bb769 100644
--- a/src/paludis/install.cc
+++ b/src/paludis/install.cc
@@ -748,6 +748,18 @@ do_install()
throw DoHelp("bad value for --dl-circular");
}
+ if (CommandLine::get_instance()->dl_fall_back.specified())
+ {
+ if (CommandLine::get_instance()->dl_fall_back.argument() == "as-needed-except-targets")
+ options.fall_back = dl_fall_back_as_needed_except_targets;
+ else if (CommandLine::get_instance()->dl_fall_back.argument() == "as-needed")
+ options.fall_back = dl_fall_back_as_needed;
+ else if (CommandLine::get_instance()->dl_fall_back.argument() == "never")
+ options.fall_back = dl_fall_back_never;
+ else
+ throw DoHelp("bad value for --dl-fall-back");
+ }
+
if (CommandLine::get_instance()->dl_installed_deps_pre.specified())
options.installed_deps_pre = enum_arg_to_dep_list_deps_option(
CommandLine::get_instance()->dl_installed_deps_pre);