aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-18 00:25:54 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-18 00:25:54 +0100
commitb67e87e3817f6816ddacdc16aa2d4935cbbd9e1c (patch)
treeeb1868aa8173bc03b4ecb58bbbc7328b418ed1d8
parentfacb2cf04d5fa94c81841c54bd4cc3ff46f06225 (diff)
downloadpaludis-b67e87e3817f6816ddacdc16aa2d4935cbbd9e1c.tar.gz
paludis-b67e87e3817f6816ddacdc16aa2d4935cbbd9e1c.tar.xz
Skip phases
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 38d4d6f..d82ba19 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -204,6 +204,33 @@ namespace
command.append(" --x-of-y '" + stringify(x) + " of " + stringify(y) + "'");
+ if (cmdline.execution_options.a_skip_phase.specified() || cmdline.execution_options.a_abort_at_phase.specified()
+ || cmdline.execution_options.a_skip_until_phase.specified())
+ {
+ bool apply(false);
+
+ if (cmdline.execution_options.a_change_phases_for.argument() == "all")
+ apply = true;
+ else if (cmdline.execution_options.a_change_phases_for.argument() == "first")
+ apply = (x == 1);
+ else if (cmdline.execution_options.a_change_phases_for.argument() == "last")
+ apply = (x == y);
+ else
+ throw args::DoHelp("Don't understand argument '"
+ + cmdline.execution_options.a_change_phases_for.argument() + "' to '--"
+ + cmdline.execution_options.a_change_phases_for.long_name() + "'");
+
+ if (apply)
+ {
+ if (cmdline.execution_options.a_skip_phase.specified())
+ command.append(" " + cmdline.execution_options.a_skip_phase.forwardable_string());
+ if (cmdline.execution_options.a_abort_at_phase.specified())
+ command.append(" " + cmdline.execution_options.a_abort_at_phase.forwardable_string());
+ if (cmdline.execution_options.a_skip_until_phase.specified())
+ command.append(" " + cmdline.execution_options.a_skip_until_phase.forwardable_string());
+ }
+ }
+
paludis::Command cmd(command);
int retcode(run_command(cmd));