Skip to content

Commit a914469

Browse files
committed
Retry to install proxies during already up-to-date self update
CC #1305 which this hopefully fixes.
1 parent 9b1b54a commit a914469

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/rustup-cli/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ pub fn update_all_channels(cfg: &Cfg, self_update: bool) -> Result<()> {
213213
try!(self_update::run_update(setup_path));
214214

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

218221
Ok(())

src/rustup-cli/self_update.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,12 @@ fn install_bins() -> Result<()> {
650650
}
651651
try!(utils::copy_file(this_exe_path, rustup_path));
652652
try!(utils::make_executable(rustup_path));
653+
install_proxies()
654+
}
655+
656+
pub fn install_proxies() -> Result<()> {
657+
let ref bin_path = try!(utils::cargo_home()).join("bin");
658+
let ref rustup_path = bin_path.join(&format!("rustup{}", EXE_SUFFIX));
653659

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

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

13521361
Ok(())

0 commit comments

Comments
 (0)