This commit is contained in:
parent
43001a0b9e
commit
66d53d227b
2 changed files with 11 additions and 7 deletions
|
@ -19,11 +19,15 @@ pub struct Mirrorlist {
|
|||
}
|
||||
|
||||
impl Mirrorlist {
|
||||
pub fn for_arch(&self, arch: Architecture) -> &[String] {
|
||||
pub fn for_arch(&self, arch: Architecture) -> Vec<String> {
|
||||
match arch {
|
||||
Architecture::x86_64 => &self.x86_64,
|
||||
Architecture::aarch64 => &self.aarch64,
|
||||
Architecture::any => &self.x86_64,
|
||||
Architecture::x86_64 => self.x86_64.clone(),
|
||||
Architecture::aarch64 => self.aarch64.clone(),
|
||||
Architecture::any => {
|
||||
let mut res = self.x86_64.clone();
|
||||
res.extend(self.aarch64.clone());
|
||||
res
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ impl MirrorRepository {
|
|||
self.inner
|
||||
.base_path(arch.clone())
|
||||
.join(format!("{}.db.tar.gz", self.inner.name)),
|
||||
mirrorlist.for_arch(arch.clone()),
|
||||
&mirrorlist.for_arch(arch.clone()),
|
||||
arch.clone(),
|
||||
)
|
||||
.await;
|
||||
|
@ -98,7 +98,7 @@ impl MirrorRepository {
|
|||
self.inner
|
||||
.base_path(arch.clone())
|
||||
.join(format!("{}.db.tar.gz.sig", self.inner.name)),
|
||||
mirrorlist.for_arch(arch.clone()),
|
||||
&mirrorlist.for_arch(arch.clone()),
|
||||
arch.clone(),
|
||||
)
|
||||
.await;
|
||||
|
@ -117,7 +117,7 @@ impl MirrorRepository {
|
|||
let (name, _, _, arch, _) = Package::extract_pkg_name(pkg_name).unwrap();
|
||||
|
||||
log::info!("Not Found. Downloading mirrored package {pkg_name}");
|
||||
self.download_package(pkg_name, &name, arch.clone(), mirrorlist.for_arch(arch))
|
||||
self.download_package(pkg_name, &name, arch.clone(), &mirrorlist.for_arch(arch))
|
||||
.await;
|
||||
|
||||
self.inner.get_pkg(pkg_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue