From 713359252aa0116b3a929565dfb964616e6c0f9b Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jeremy@system76.com> Date: Sun, 12 May 2019 08:15:18 -0600 Subject: [PATCH] 0.2.2 - fix cargo doc --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82e3557..51df37c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -477,7 +477,7 @@ dependencies = [ [[package]] name = "redox_installer" -version = "0.2.1" +version = "0.2.2" dependencies = [ "arg_parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index c40533f..3475a25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redox_installer" -version = "0.2.1" +version = "0.2.2" description = "A Redox filesystem builder" license = "MIT" authors = ["Jeremy Soller <jackpot51@gmail.com>"] diff --git a/src/lib.rs b/src/lib.rs index 1126a21..2144ba6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,8 +74,6 @@ fn prompt_password(prompt: &str, confirm_prompt: &str) -> Result<String> { print!("\n{}", confirm_prompt); let confirm_password = stdin.read_passwd(&mut stdout)?; - // TODO: Remove this debug msg - println!("\nPass: {:?}; ConfPass: {:?};", password, confirm_password); // Note: Actually comparing two Option<String> values if confirm_password == password { @@ -86,7 +84,12 @@ fn prompt_password(prompt: &str, confirm_prompt: &str) -> Result<String> { } fn install_packages<S: AsRef<str>>(config: &Config, dest: &str, cookbook: Option<S>) { - let target = &env::var("TARGET").unwrap_or(env!("TARGET").to_string()); + let target = &env::var("TARGET").unwrap_or( + option_env!("TARGET").map_or( + "x86_64-unknown-redox".to_string(), + |x| x.to_string() + ) + ); let mut repo = Repo::new(target); repo.add_remote(REMOTE); @@ -122,7 +125,7 @@ fn install_packages<S: AsRef<str>>(config: &Config, dest: &str, cookbook: Option pub fn install<P: AsRef<Path>, S: AsRef<str>>(config: Config, output_dir: P, cookbook: Option<S>) -> Result<()> { let mut context = liner::Context::new(); - + macro_rules! prompt { ($dst:expr, $def:expr, $($arg:tt)*) => (if config.general.prompt { match unwrap_or_prompt($dst, &mut context, &format!($($arg)*)) { @@ -215,7 +218,7 @@ pub fn install<P: AsRef<Path>, S: AsRef<str>>(config: Config, output_dir: P, coo gid: None }.create(&output_dir)?; } - + if !shadow.is_empty() { FileConfig { path: "/etc/shadow".to_string(), -- GitLab