This commit is contained in:
+4
-4
@@ -227,12 +227,12 @@ async fn download_file_checksum(
|
||||
// Download with reqwest
|
||||
let response = reqwest::get(url).await?;
|
||||
if !response.status().is_success() {
|
||||
return Err(format!("Failed to download '{}' : {}", &url, response.status()).into());
|
||||
return Err(format!("Failed to download '{}' : {}", url, response.status()).into());
|
||||
}
|
||||
|
||||
let total_size = response
|
||||
.content_length()
|
||||
.ok_or(format!("Failed to get content length from '{}'", &url))?;
|
||||
.ok_or(format!("Failed to get content length from '{}'", url))?;
|
||||
let mut index = 0;
|
||||
|
||||
// Target file: extract file name from URL
|
||||
@@ -342,7 +342,7 @@ async fn fetch_orig_tarball(
|
||||
// or the current directory if cwd is None (which effectively is the parent of the package dir)
|
||||
let target_dir = cwd.unwrap_or_else(|| Path::new("."));
|
||||
download_file_checksum(
|
||||
format!("{}/{}", &info.archive_url, filename).as_str(),
|
||||
format!("{}/{}", info.archive_url, filename).as_str(),
|
||||
&orig_file.sha256,
|
||||
target_dir,
|
||||
progress,
|
||||
@@ -372,7 +372,7 @@ async fn fetch_dsc_file(
|
||||
debug!("Fetching dsc file: {}", filename);
|
||||
|
||||
download_file_checksum(
|
||||
format!("{}/{}", &info.archive_url, filename).as_str(),
|
||||
format!("{}/{}", info.archive_url, filename).as_str(),
|
||||
&dsc_file.sha256,
|
||||
target_dir,
|
||||
progress,
|
||||
|
||||
Reference in New Issue
Block a user