aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 15:48:38 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 19:57:04 +0100
commit1bbba7ebeeacfa5209e29df627cab51107319f6b (patch)
tree85b700b57703a1282a28011920a4d065f9d1897d
parent7dc43ea4ab5bf8cf669824d02b5d8f24d651256a (diff)
downloadpaludis-1bbba7ebeeacfa5209e29df627cab51107319f6b.tar.gz
paludis-1bbba7ebeeacfa5209e29df627cab51107319f6b.tar.xz
SetFile -> Process
-rw-r--r--paludis/set_file.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 2ed7c83..6cb959e 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -28,6 +28,7 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/system.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/process.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/selection.hh>
@@ -535,15 +536,16 @@ PaludisBashHandler::PaludisBashHandler(const SetFileParams & p) :
_contents = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
std::stringstream s;
- Command cmd(Command("bash '" + stringify(_p.file_name()) + "'")
- .with_setenv("ROOT", _p.environment() ? stringify(_p.environment()->preferred_root_key()->value()) : "/")
- .with_setenv("SET", stringify(_p.file_name()))
- .with_setenv("SET_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
- .with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
- .with_setenv("PALUDIS_COMMAND", _p.environment() ? _p.environment()->paludis_command() : "")
- .with_stderr_prefix(_p.file_name().basename() + "> ")
- .with_captured_stdout_stream(&s));
- int exit_status(run_command(cmd));
+ Process process(ProcessCommand({ "bash", stringify(_p.file_name()) }));
+ process
+ .setenv("ROOT", _p.environment() ? stringify(_p.environment()->preferred_root_key()->value()) : "/")
+ .setenv("SET", stringify(_p.file_name()))
+ .setenv("SET_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
+ .setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
+ .setenv("PALUDIS_COMMAND", _p.environment() ? _p.environment()->paludis_command() : "")
+ .prefix_stderr(_p.file_name().basename() + "> ")
+ .capture_stdout(s);
+ int exit_status(process.run().wait());
LineConfigFile ff(s, { lcfo_disallow_continuations, lcfo_disallow_comments, lcfo_no_skip_blank_lines });
for (LineConfigFile::ConstIterator line(ff.begin()), line_end(ff.end()) ;