From fdaf507fe83689474cc9a21ff93a8568dcbaa07e Mon Sep 17 00:00:00 2001 From: CrazyMerlyn Date: Tue, 16 May 2017 00:34:50 +0530 Subject: [PATCH] Exit successfully on "update not yet available" --- src/rustup-dist/src/dist.rs | 3 +++ tests/cli-v2.rs | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rustup-dist/src/dist.rs b/src/rustup-dist/src/dist.rs index b7fde7d4ef3..e74fd48a971 100644 --- a/src/rustup-dist/src/dist.rs +++ b/src/rustup-dist/src/dist.rs @@ -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), } diff --git a/tests/cli-v2.rs b/tests/cli-v2.rs index f55674a6dc4..dd6da4228d6 100644 --- a/tests/cli-v2.rs +++ b/tests/cli-v2.rs @@ -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"]); }); }