Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/rustup-cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ pub fn update_all_channels(cfg: &Cfg, self_update: bool) -> Result<()> {
try!(self_update::run_update(setup_path));

unreachable!(); // update exits on success
} else if self_update {
// Try again in case we emitted "tool `{}` is already installed" last time.
self_update::install_proxies()?;
}

Ok(())
Expand Down
9 changes: 9 additions & 0 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,12 @@ fn install_bins() -> Result<()> {
}
try!(utils::copy_file(this_exe_path, rustup_path));
try!(utils::make_executable(rustup_path));
install_proxies()
}

pub fn install_proxies() -> Result<()> {
let ref bin_path = try!(utils::cargo_home()).join("bin");
let ref rustup_path = bin_path.join(&format!("rustup{}", EXE_SUFFIX));

// Record the size of the known links, then when we get files which may or
// may not be links, we compare their size. Same size means probably a link.
Expand Down Expand Up @@ -1347,6 +1353,9 @@ pub fn update() -> Result<()> {

info!("rustup updated successfully to {}", version);
try!(run_update(p));
} else {
// Try again in case we emitted "tool `{}` is already installed" last time.
install_proxies()?
}

Ok(())
Expand Down