Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit successfully on "update not yet available" #1120

Merged
merged 1 commit into from
May 19, 2017
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-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