download_verified_file

Function download_verified_file 

Source
pub fn download_verified_file(
    url: &str,
    dest: &Path,
    expected_sha256: &str,
    label: &str,
    cli_label: &str,
    mp: Option<&FetchProgress>,
) -> Result<()>
Expand description

Download a single file from url to dest, streaming through the DownloadStream watchdog + progress bar and verifying the resulting SHA-256 against expected_sha256 (hex, case-insensitive).

Used by prebuilt-distro-kernel acquisition (crate::distro::acquire) to fetch each .rpm/.deb package and its (up to ~1 GiB) debuginfo. Rides the same transient-retry seam (TRANSIENT_HTTP_RETRY) and no-progress watchdog (DOWNLOAD_NO_PROGRESS_TIMEOUT, which tracks body progress rather than total time so a large but progressing download is never aborted) as the kernel-source tarball path. Unlike the tarball downloaders it does not extract — the bytes land verbatim at dest for the caller to unpack. label names the package on its progress bar; cli_label prefixes the size status line.