diff --git a/components/script/build.rs b/components/script/build.rs index ca5ecaf9369..88b1e22b953 100644 --- a/components/script/build.rs +++ b/components/script/build.rs @@ -2,17 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#![feature(io)] - -use std::old_io::process::{Command, ProcessExit, StdioContainer}; - +use std::process::Command; fn main() { - let result = Command::new("make") + assert!(Command::new("make") .args(&["-f", "makefile.cargo"]) - .stdout(StdioContainer::InheritFd(1)) - .stderr(StdioContainer::InheritFd(2)) .status() - .unwrap(); - assert_eq!(result, ProcessExit::ExitStatus(0)); + .unwrap() + .success()); } diff --git a/components/style/build.rs b/components/style/build.rs index ff177c4f702..8e2117614cf 100644 --- a/components/style/build.rs +++ b/components/style/build.rs @@ -2,32 +2,33 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#![feature(env, old_io, old_path)] +#![feature(io, path)] use std::env; -use std::old_path::Path; -use std::old_io::process::{Command, ProcessExit, StdioContainer}; -use std::old_io::File; +use std::fs::File; +use std::io::Write; +use std::process::{Command, Stdio}; +use std::path::Path; fn main() { - let python = if Command::new("python2.7").arg("--version").status() == Ok(ProcessExit::ExitStatus(0)) { + let python = if Command::new("python2.7").arg("--version").status().unwrap().success() { "python2.7" } else { "python" }; - let style = Path::new(file!()).dir_path(); + let style = Path::new(file!()).parent().unwrap(); let mako = style.join("Mako-0.9.1.zip"); let template = style.join("properties.mako.rs"); let result = Command::new(python) - .env("PYTHONPATH", mako.as_str().unwrap()) - .env("TEMPLATE", template.as_str().unwrap()) + .env("PYTHONPATH", &mako) + .env("TEMPLATE", &template) .arg("-c") .arg("from os import environ; from mako.template import Template; print(Template(filename=environ['TEMPLATE']).render())") - .stderr(StdioContainer::InheritFd(2)) + .stderr(Stdio::inherit()) .output() .unwrap(); - assert_eq!(result.status, ProcessExit::ExitStatus(0)); - let out = Path::new(env::var("OUT_DIR").unwrap()); - File::create(&out.join("properties.rs")).unwrap().write_all(&*result.output).unwrap(); + assert!(result.status.success()); + let out = env::var("OUT_DIR").unwrap(); + File::create(&Path::new(&out).join("properties.rs")).unwrap().write_all(&result.stdout).unwrap(); } diff --git a/support/rust-task_info/build.rs b/support/rust-task_info/build.rs index f2dc14999c4..99552a2ed48 100644 --- a/support/rust-task_info/build.rs +++ b/support/rust-task_info/build.rs @@ -2,21 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#![feature(env)] -#![feature(io)] -#![feature(old_io)] - -use std::old_io::process::{Command, ProcessExit, StdioContainer}; +use std::process::Command; use std::env; fn main() { - let out_dir = env::var("OUT_DIR").unwrap(); - let result = Command::new("make") + assert!(Command::new("make") .args(&["-f", "makefile.cargo"]) - .stdout(StdioContainer::InheritFd(1)) - .stderr(StdioContainer::InheritFd(2)) .status() - .unwrap(); - assert_eq!(result, ProcessExit::ExitStatus(0)); - println!("cargo:rustc-flags=-L native={}", out_dir); + .unwrap() + .success()); + println!("cargo:rustc-flags=-L native={}", env::var("OUT_DIR").unwrap()); }