From b75b02dc862b350d1f8127751e3d1b74ed6dc4b0 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 11 Apr 2016 01:35:43 +0000 Subject: [PATCH] Make rustup-init work when called as rustup-setup --- src/multirust-cli/main.rs | 1 + tests/cli-self-update.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/multirust-cli/main.rs b/src/multirust-cli/main.rs index 7fc73ebef73..f13feec5d62 100644 --- a/src/multirust-cli/main.rs +++ b/src/multirust-cli/main.rs @@ -76,6 +76,7 @@ fn run_multirust() -> Result<()> { multirust_mode::main() } Some(n) if n.starts_with("multirust-setup")|| + n.starts_with("rustup-setup") || n.starts_with("rustup-init") => { // NB: The above check is only for the prefix of the file // name. Browsers rename duplicates to diff --git a/tests/cli-self-update.rs b/tests/cli-self-update.rs index 59fc036a7e6..e6447091db1 100644 --- a/tests/cli-self-update.rs +++ b/tests/cli-self-update.rs @@ -699,6 +699,18 @@ fn multirust_still_works_after_update() { fn update_stress_test() { } +// The installer used to be called rustup-setup. For compatibility it +// still needs to work in that mode. +#[test] +fn as_rustup_setup() { + update_setup(&|config, _| { + let init = config.exedir.join(format!("rustup-init{}", EXE_SUFFIX)); + let setup = config.exedir.join(format!("rustup-setup{}", EXE_SUFFIX)); + fs::copy(&init, &setup).unwrap(); + expect_ok(config, &["rustup-setup", "-y"]); + }); +} + #[test] fn first_install_exact() { setup(&|config| {