aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-05 17:36:38 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-05 17:36:38 +0100
commitb1422adf39fa146714e4177c795beae5f12fd4a0 (patch)
tree334419d4d8481a4524d299e14aa76dc3d0946bdd
parent736ac3c1adfdbea0aa44d9bbfe15935b4105830e (diff)
downloadpaludis-b1422adf39fa146714e4177c795beae5f12fd4a0.tar.gz
paludis-b1422adf39fa146714e4177c795beae5f12fd4a0.tar.xz
run pretend actions
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc7
-rw-r--r--src/clients/cave/cmd_resolve.cc5
2 files changed, 10 insertions, 2 deletions
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 2d13f39..ebfa68b 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -66,10 +66,15 @@ namespace
struct ExecuteResolutionCommandLine :
CaveCommandCommandLine
{
+ args::ArgsGroup g_general_options;
+ args::SwitchArg a_pretend;
+
ResolveCommandLineExecutionOptions execution_options;
ResolveCommandLineProgramOptions program_options;
ExecuteResolutionCommandLine() :
+ g_general_options(main_options_section(), "General Options", "General options."),
+ a_pretend(&g_general_options, "pretend", '\0', "Only carry out the pretend action", false),
execution_options(this),
program_options(this)
{
@@ -204,7 +209,7 @@ namespace
c != c_end ; ++c)
retcode |= do_pretend(env, cmdline, (*c)->decision());
- if (0 != retcode)
+ if (0 != retcode || cmdline.a_pretend.specified())
return retcode;
for (Resolutions::ConstIterator c(lists.ordered()->begin()), c_end(lists.ordered()->end()) ;
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index a88696d..af0ea0b 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -582,6 +582,9 @@ namespace
command = command + " " + (*o)->forwardable_string();
}
+ if (! cmdline.resolution_options.a_execute.specified())
+ command = command + " --pretend";
+
paludis::Command cmd(command);
cmd
.with_input_stream(&ser_stream, -1, "PALUDIS_SERIALISED_RESOLUTION_FD");
@@ -698,7 +701,7 @@ ResolveCommand::run(
}
retcode |= display_resolution(env, *resolver->resolution_lists(), cmdline);
- if (0 == retcode && cmdline.resolution_options.a_execute.specified())
+ if (0 == retcode)
perform_resolution(env, *resolver->resolution_lists(), cmdline);
}
catch (...)