diff --git a/src/rustup-dist/src/dist.rs b/src/rustup-dist/src/dist.rs index a833ef85eae..c9dd6cc0533 100644 --- a/src/rustup-dist/src/dist.rs +++ b/src/rustup-dist/src/dist.rs @@ -489,6 +489,7 @@ pub fn update_from_dist_<'a>(download: DownloadCfg<'a>, (download.notify_handler)(Notification::DownloadingManifest(&toolchain_str)); match dl_v2_manifest(download, update_hash, toolchain) { Ok(Some((m, hash))) => { + (download.notify_handler)(Notification::DownloadedManifest(&m.date, m.get_rust_version().ok())); return match try!(manifestation.update(&m, changes, &download, diff --git a/src/rustup-dist/src/manifest.rs b/src/rustup-dist/src/manifest.rs index 9953ef32399..0ad8579925e 100644 --- a/src/rustup-dist/src/manifest.rs +++ b/src/rustup-dist/src/manifest.rs @@ -119,6 +119,10 @@ impl Manifest { || format!("package not found: '{}'", name).into()) } + pub fn get_rust_version(&self) -> Result<&str> { + self.get_package("rust").map(|p| &*p.version) + } + fn validate_targeted_package(&self, tpkg: &TargetedPackage) -> Result<()> { for c in tpkg.components.iter().chain(tpkg.extensions.iter()) { let cpkg = try!(self.get_package(&c.pkg).chain_err(|| ErrorKind::MissingPackageForComponent(c.clone()))); diff --git a/src/rustup-dist/src/notifications.rs b/src/rustup-dist/src/notifications.rs index 5762007d5c5..4ad534dc29b 100644 --- a/src/rustup-dist/src/notifications.rs +++ b/src/rustup-dist/src/notifications.rs @@ -28,6 +28,7 @@ pub enum Notification<'a> { InstallingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>), RemovingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>), DownloadingManifest(&'a str), + DownloadedManifest(&'a str, Option<&'a str>), DownloadingLegacyManifest, ManifestChecksumFailedHack, } @@ -59,7 +60,8 @@ impl<'a> Notification<'a> { RemovingComponent(_, _, _) | ComponentAlreadyInstalled(_) | ManifestChecksumFailedHack | - RollingBack | DownloadingManifest(_) => NotificationLevel::Info, + RollingBack | DownloadingManifest(_) | + DownloadedManifest(_, _) => NotificationLevel::Info, CantReadUpdateHash(_) | ExtensionNotInstalled(_) | MissingInstalledComponent(_) | CachedFileChecksumFailed => NotificationLevel::Warn, NonFatalError(_) => NotificationLevel::Error, @@ -115,6 +117,8 @@ impl<'a> Display for Notification<'a> { } } DownloadingManifest(t) => write!(f, "syncing channel updates for '{}'", t), + DownloadedManifest(date, Some(version)) => write!(f, "latest update on {}, rust version {}", date, version), + DownloadedManifest(date, None) => write!(f, "latest update on {}, no rust version", date), DownloadingLegacyManifest => write!(f, "manifest not found. trying legacy manifest"), ManifestChecksumFailedHack => write!(f, "update not yet available, sorry! try again later"), } diff --git a/tests/cli-exact.rs b/tests/cli-exact.rs index 17a76f5dbf8..d9e550e39c5 100644 --- a/tests/cli-exact.rs +++ b/tests/cli-exact.rs @@ -27,6 +27,7 @@ for_host!(r" "), for_host!(r"info: syncing channel updates for 'nightly-{0}' +info: latest update on 2015-01-02, rust version 1.3.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -62,6 +63,7 @@ for_host!(r" "), for_host!(r"info: syncing channel updates for 'nightly-{0}' +info: latest update on 2015-01-02, rust version 1.3.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -248,6 +250,7 @@ fn update_invalid_toolchain() { expect_err_ex(config, &["rustup", "update", "nightly-2016-03-1"], r"", r"info: syncing channel updates for 'nightly-2016-03-1' +info: latest update on 2015-01-02, rust version 1.3.0 error: target not found: '2016-03-1' "); }); @@ -259,6 +262,7 @@ fn default_invalid_toolchain() { expect_err_ex(config, &["rustup", "default", "nightly-2016-03-1"], r"", r"info: syncing channel updates for 'nightly-2016-03-1' +info: latest update on 2015-01-02, rust version 1.3.0 error: target not found: '2016-03-1' "); }); diff --git a/tests/cli-rustup.rs b/tests/cli-rustup.rs index 0dab4a693e7..7d8f0f2dc16 100644 --- a/tests/cli-rustup.rs +++ b/tests/cli-rustup.rs @@ -36,6 +36,7 @@ for_host!(r" "), for_host!(r"info: syncing channel updates for 'stable-{0}' +info: latest update on 2015-01-02, rust version 1.1.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -83,6 +84,7 @@ for_host!(r" "), for_host!(r"info: syncing channel updates for 'stable-{0}' +info: latest update on 2015-01-02, rust version 1.1.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -96,6 +98,7 @@ info: installing component 'rustc' info: installing component 'cargo' info: installing component 'rust-docs' info: syncing channel updates for 'beta-{0}' +info: latest update on 2015-01-02, rust version 1.2.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -109,6 +112,7 @@ info: installing component 'rustc' info: installing component 'cargo' info: installing component 'rust-docs' info: syncing channel updates for 'nightly-{0}' +info: latest update on 2015-01-02, rust version 1.3.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -142,6 +146,7 @@ for_host!(r" "), for_host!(r"info: syncing channel updates for 'stable-{0}' +info: latest update on 2015-01-02, rust version 1.1.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -156,6 +161,7 @@ info: installing component 'cargo' info: installing component 'rust-docs' info: syncing channel updates for 'beta-{0}' info: syncing channel updates for 'nightly-{0}' +info: latest update on 2015-01-02, rust version 1.3.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' @@ -193,6 +199,7 @@ for_host!(r" "), for_host!(r"info: syncing channel updates for 'nightly-{0}' +info: latest update on 2015-01-02, rust version 1.3.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo' diff --git a/tests/cli-self-upd.rs b/tests/cli-self-upd.rs index 3860c8672a3..854e2fdaa77 100644 --- a/tests/cli-self-upd.rs +++ b/tests/cli-self-upd.rs @@ -758,6 +758,7 @@ r" ", for_host!(r"info: syncing channel updates for 'stable-{0}' +info: latest update on 2015-01-02, rust version 1.1.0 info: downloading component 'rust-std' info: downloading component 'rustc' info: downloading component 'cargo'