aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 11:29:00 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 19:57:04 +0100
commitd68552f54ccd08a6d59c83dbea0c9eda6dc72735 (patch)
treedd75581a25e3b9275582288381742c1257ab1b30
parentd5e0dddcde172cef1c673d76728d2af441af3741 (diff)
downloadpaludis-d68552f54ccd08a6d59c83dbea0c9eda6dc72735.tar.gz
paludis-d68552f54ccd08a6d59c83dbea0c9eda6dc72735.tar.xz
syncer -> Process
-rw-r--r--paludis/syncer.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index cbcbad2..55f62c9 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006 Stephen Klimaszewski
* Copyright (c) 2007 David Leverton
*
@@ -24,6 +24,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/process.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -91,20 +92,20 @@ DefaultSyncer::sync(const SyncOptions & opts) const
std::shared_ptr<const FSEntrySequence> fetchers_dirs(_environment->fetchers_dirs());
std::shared_ptr<const FSEntrySequence> syncers_dirs(_environment->syncers_dirs());
- Command cmd(Command(stringify(_syncer) + " " + opts.options() + " '" + _local + "' '" + _remote + "'")
- .with_setenv("PALUDIS_ACTION", "sync")
- .with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
- .with_setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
- .with_setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
- .with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
- .with_setenv("PALUDIS_SYNC_FILTER_FILE", stringify(opts.filter_file())));
+ Process process(ProcessCommand(stringify(_syncer) + " " + opts.options() + " '" + _local + "' '" + _remote + "'"));
- cmd
- .with_captured_stderr_stream(&opts.output_manager()->stderr_stream())
- .with_captured_stdout_stream(&opts.output_manager()->stdout_stream())
- .with_ptys();
+ process
+ .setenv("PALUDIS_ACTION", "sync")
+ .setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
+ .setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
+ .setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
+ .setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
+ .setenv("PALUDIS_SYNC_FILTER_FILE", stringify(opts.filter_file()))
+ .capture_stderr(opts.output_manager()->stderr_stream())
+ .capture_stdout(opts.output_manager()->stdout_stream())
+ .use_ptys();
- if (run_command(cmd))
+ if (0 != process.run().wait())
throw SyncFailedError(_local, _remote);
}