From: Rust Maintainers Date: Tue, 25 Jul 2017 21:19:47 +0000 (+0100) Subject: u-fix-build_02 X-Git-Tag: archive/raspbian/1.19.0+dfsg3-4+rpi1~1^2~25 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=75ec8088155b283fd9cfcf4d8b200df2821f4cdf;p=rustc.git u-fix-build_02 Gbp-Pq: Name u-fix-build_02.patch --- diff --git a/src/bootstrap/bin/main.rs b/src/bootstrap/bin/main.rs index 5ca5ce1648..5ef18b8984 100644 --- a/src/bootstrap/bin/main.rs +++ b/src/bootstrap/bin/main.rs @@ -26,12 +26,6 @@ use bootstrap::{Flags, Config, Build}; fn main() { let args = env::args().skip(1).collect::>(); let flags = Flags::parse(&args); - let mut config = Config::parse(&flags.build, flags.config.clone()); - - // compat with `./configure` while we're still using that - if std::fs::metadata("config.mk").is_ok() { - config.update_with_config_mk(); - } - + let config = Config::parse(&flags.build, flags.config.clone()); Build::new(flags, config).build(); } diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 34fbc33d98..8c1724b997 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -15,7 +15,7 @@ use std::collections::HashMap; use std::env; -use std::fs::File; +use std::fs::{self, File}; use std::io::prelude::*; use std::path::PathBuf; use std::process; @@ -395,6 +395,12 @@ impl Config { set(&mut config.rust_dist_src, t.src_tarball); } + + // compat with `./configure` while we're still using that + if fs::metadata("config.mk").is_ok() { + config.update_with_config_mk(); + } + return config } @@ -403,7 +409,7 @@ impl Config { /// While we still have `./configure` this implements the ability to decode /// that configuration into this. This isn't exactly a full-blown makefile /// parser, but hey it gets the job done! - pub fn update_with_config_mk(&mut self) { + fn update_with_config_mk(&mut self) { let mut config = String::new(); File::open("config.mk").unwrap().read_to_string(&mut config).unwrap(); for line in config.lines() {