Skip to content

Commit

Permalink
rustup-dist: Use Download notifications to track install
Browse files Browse the repository at this point in the history
People have requested some indication of progress for long-running
install steps.  This commit uses the new FileReaderWithProgress to
provide a progress bar (the length is the compressed component
tarball but should be good enough) to provide such feedback.

Fixes: rust-lang#1557

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
  • Loading branch information
kinnison committed Jan 14, 2019
1 parent fed7877 commit aaead82
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rustup-dist/src/manifestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,18 @@ impl Manifestation {

let gz;
let xz;
let notification_converter = |notification: rustup_utils::Notification| {
notify_handler(Notification::Utils(notification));
};
let reader =
utils::FileReaderWithProgress::new_file(&installer_file, &notification_converter)?;
let package: &Package = match format {
Format::Gz => {
gz = TarGzPackage::new_file(&installer_file, temp_cfg)?;
gz = TarGzPackage::new(reader, temp_cfg)?;
&gz
}
Format::Xz => {
xz = TarXzPackage::new_file(&installer_file, temp_cfg)?;
xz = TarXzPackage::new(reader, temp_cfg)?;
&xz
}
};
Expand Down

0 comments on commit aaead82

Please sign in to comment.