🩹 fix any pkg download
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2025-04-27 19:23:07 +02:00
parent 66d53d227b
commit 36934fccfe
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
3 changed files with 26 additions and 6 deletions

View file

@ -1,5 +1,6 @@
use std::path::PathBuf;
use async_recursion::async_recursion;
use comrade::rally;
use crate::config::Mirrorlist;
@ -18,6 +19,7 @@ impl MirrorRepository {
}
}
#[async_recursion]
pub async fn download_file(
&self,
url: &str,
@ -27,11 +29,14 @@ impl MirrorRepository {
) {
log::info!("Downloading {url} to {}", file_path.to_str().unwrap());
let arch = if matches!(arch, Architecture::any) {
Architecture::x86_64.to_string() // `any` packages dont get served under repo "any" for some reason
} else {
arch.to_string()
};
if matches!(arch, Architecture::any) {
// `any` packages dont get served under repo "any" for some reason
self.download_file(url, file_path.clone(), mirrorlist, Architecture::x86_64)
.await;
self.download_file(url, file_path, mirrorlist, Architecture::aarch64)
.await;
return;
}
let parent = file_path.parent().unwrap();
std::fs::create_dir_all(parent).unwrap();
@ -40,7 +45,9 @@ impl MirrorRepository {
.into_iter()
.take(5)
.map(|x| {
let mirror = x.replace("$repo", &self.inner.name).replace("$arch", &arch);
let mirror = x
.replace("$repo", &self.inner.name)
.replace("$arch", &arch.to_string());
(
x.clone(),