From 76c31217bee0f80b096b33d8a1b499f491d92c9f Mon Sep 17 00:00:00 2001 From: gareth Date: Sun, 12 May 2013 13:58:00 +0100 Subject: Refactor core::run in order to address many of the issues mentioned in #2625. This change makes the module more oriented around Process values instead of having to deal with process ids directly. Apart from issues mentioned in #2625, other changes include: - Changing the naming to be more consistent - Process/process is now used instead of a mixture of Program/program and Process/process. - More docs/tests. Some io/scheduler related issues remain (mentioned in #2625). --- src/librustpkg/rustpkg.rc | 8 ++++---- src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/librustpkg') diff --git a/src/librustpkg/rustpkg.rc b/src/librustpkg/rustpkg.rc index 79e978c01d1..a419bffece7 100644 --- a/src/librustpkg/rustpkg.rc +++ b/src/librustpkg/rustpkg.rc @@ -131,17 +131,17 @@ impl<'self> PkgScript<'self> { &exe, @copy os::args()[0], driver::cu_everything); debug!("Running program: %s %s %s", exe.to_str(), root.to_str(), what); - let status = run::run_program(exe.to_str(), [root.to_str(), what]); + let status = run::process_status(exe.to_str(), [root.to_str(), what]); if status != 0 { return (~[], status); } else { debug!("Running program (configs): %s %s %s", exe.to_str(), root.to_str(), "configs"); - let output = run::program_output(exe.to_str(), [root.to_str(), ~"configs"]); + let output = run::process_output(exe.to_str(), [root.to_str(), ~"configs"]); // Run the configs() function to get the configs let mut cfgs = ~[]; - for str::each_word(output.out) |w| { + for str::each_word(str::from_bytes(output.output)) |w| { cfgs.push(w.to_owned()); } (cfgs, output.status) @@ -551,7 +551,7 @@ impl PkgSrc { let url = fmt!("https://%s", self.id.remote_path.to_str()); util::note(fmt!("git clone %s %s", url, local.to_str())); - if run::program_output("git", [~"clone", copy url, local.to_str()]).status != 0 { + if run::process_output("git", [~"clone", copy url, local.to_str()]).status != 0 { util::note(fmt!("fetching %s failed: can't clone repository", url)); return false; } diff --git a/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs b/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs index eeaa0f68ed5..2d3a75d9197 100644 --- a/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs +++ b/src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs @@ -23,6 +23,6 @@ pub fn main() { file.write_str("pub fn wheeeee() { for [1, 2, 3].each() |_| { assert!(true); } }"); // now compile the crate itself - run::run_program("rustc", ~[~"src/fancy-lib/fancy-lib.rs", ~"--lib", - ~"-o", out_path.push(~"fancy_lib").to_str()]); + run::process_status("rustc", [~"src/fancy-lib/fancy-lib.rs", ~"--lib", ~"-o", + out_path.push(~"fancy_lib").to_str()]); } \ No newline at end of file -- cgit 1.4.1-3-g733a5