Skip to content

Commit

Permalink
Exit successfully on "update not yet available"
Browse files Browse the repository at this point in the history
  • Loading branch information
crazymerlyn committed May 17, 2017
1 parent a1c6be1 commit 1203d6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/rustup-dist/src/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ pub fn update_from_dist_<'a>(download: DownloadCfg<'a>,
// Proceed to try v1 as a fallback
(download.notify_handler)(Notification::DownloadingLegacyManifest);
}
Err(Error(ErrorKind::ChecksumFailed { .. }, _)) => {
return Ok(None)
}
Err(e) => return Err(e),
}

Expand Down
2 changes: 1 addition & 1 deletion src/rustup/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<'a> Toolchain<'a> {
(true, false) => UpdateStatus::Installed,
(true, true) => UpdateStatus::Updated,
(false, true) => UpdateStatus::Unchanged,
(false, false) => unreachable!(),
(false, false) => UpdateStatus::Unchanged,
};

Ok(status)
Expand Down
3 changes: 1 addition & 2 deletions tests/cli-v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ fn bad_sha_on_manifest() {
sha_bytes[..10].clone_from_slice(b"aaaaaaaaaa");
let sha_str = String::from_utf8(sha_bytes).unwrap();
rustup_utils::raw::write_file(&sha_file, &sha_str).unwrap();
expect_err(config, &["rustup", "default", "nightly"],
"checksum failed");
expect_ok(config, &["rustup", "default", "nightly"]);
});
}

Expand Down

0 comments on commit 1203d6e

Please sign in to comment.