aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-20 19:43:08 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 19:57:03 +0100
commit62018097a314bd8d4e11ba5c769e0dfd3135fa2d (patch)
tree7a03e01fe5779eef8271b74f1ba616c0248bcc7d
parent157f7e333c3e22b6e1ae47ff7016492c77cc304e (diff)
downloadpaludis-62018097a314bd8d4e11ba5c769e0dfd3135fa2d.tar.gz
paludis-62018097a314bd8d4e11ba5c769e0dfd3135fa2d.tar.xz
execute-resolution -> Process
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 1945aba..c864201 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -48,6 +48,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/process.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
@@ -242,12 +243,11 @@ namespace
command = command + " " + args::escape(*a);
IPCInputManager input_manager(env.get(), std::function<void (const std::shared_ptr<OutputManager> &)>());
- paludis::Command cmd(command);
- cmd
- .with_pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler())
- ;
- retcode = run_command(cmd);
+ Process process(ProcessCommand({ "sh", "-c", command }));
+ process.pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler());
+
+ retcode = process.run().wait();
const std::shared_ptr<OutputManager> output_manager(input_manager.underlying_output_manager_if_constructed());
if (output_manager)
{
@@ -396,12 +396,10 @@ namespace
IPCInputManager input_manager(env.get(), std::bind(&set_output_manager, std::ref(job_mutex),
std::ref(active_state), std::placeholders::_1));
- paludis::Command cmd(command);
- cmd
- .with_pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler())
- ;
+ Process process(ProcessCommand({ "sh", "-c", command }));
+ process.pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler());
- int retcode(run_command(cmd));
+ int retcode(process.run().wait());
return 0 == retcode;
}
@@ -475,12 +473,10 @@ namespace
IPCInputManager input_manager(env.get(), std::bind(&set_output_manager, std::ref(job_mutex),
std::ref(active_state), std::placeholders::_1));
- paludis::Command cmd(command);
- cmd
- .with_pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler())
- ;
+ Process process(ProcessCommand({ "sh", "-c", command }));
+ process.pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler());
- int retcode(run_command(cmd));
+ int retcode(process.run().wait());
const std::shared_ptr<OutputManager> output_manager(input_manager.underlying_output_manager_if_constructed());
return 0 == retcode;
}
@@ -547,12 +543,11 @@ namespace
IPCInputManager input_manager(env.get(), std::bind(&set_output_manager, std::ref(job_mutex),
std::ref(active_state), std::placeholders::_1));
- paludis::Command cmd(command);
- cmd
- .with_pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler())
- ;
- int retcode(run_command(cmd));
+ Process process(ProcessCommand({ "sh", "-c", command }));
+ process.pipe_command_handler("PALUDIS_IPC", input_manager.pipe_command_handler());
+
+ int retcode(process.run().wait());
const std::shared_ptr<OutputManager> output_manager(input_manager.underlying_output_manager_if_constructed());
if (output_manager)
output_manager->succeeded();
@@ -647,8 +642,8 @@ namespace
if (any)
{
- paludis::Command cmd(command);
- if (0 != run_command(cmd))
+ Process process(ProcessCommand({ "sh", "-c", command }));
+ if (0 != process.run().wait())
throw ActionAbortedError("Updating world failed");
}
}