mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
feat: add --arch flag to start-cli registry package download
Use the new flag in the image build recipe to download the tor s9pk for the target architecture, replacing the standalone download script.
This commit is contained in:
@@ -2656,6 +2656,13 @@ help.arg.allow-partial-backup:
|
||||
fr_FR: "Laisser le média monté même si backupfs échoue à monter"
|
||||
pl_PL: "Pozostaw nośnik zamontowany nawet jeśli backupfs nie może się zamontować"
|
||||
|
||||
help.arg.architecture:
|
||||
en_US: "Target CPU architecture (e.g. x86_64, aarch64)"
|
||||
de_DE: "Ziel-CPU-Architektur (z.B. x86_64, aarch64)"
|
||||
es_ES: "Arquitectura de CPU objetivo (ej. x86_64, aarch64)"
|
||||
fr_FR: "Architecture CPU cible (ex. x86_64, aarch64)"
|
||||
pl_PL: "Docelowa architektura CPU (np. x86_64, aarch64)"
|
||||
|
||||
help.arg.architecture-mask:
|
||||
en_US: "Filter by CPU architecture"
|
||||
de_DE: "Nach CPU-Architektur filtern"
|
||||
|
||||
@@ -418,6 +418,9 @@ pub struct CliDownloadParams {
|
||||
pub target_version: Option<VersionRange>,
|
||||
#[arg(short, long, help = "help.arg.destination-path")]
|
||||
pub dest: Option<PathBuf>,
|
||||
#[arg(long, short, help = "help.arg.architecture")]
|
||||
#[ts(type = "string | null")]
|
||||
pub arch: Option<InternedString>,
|
||||
}
|
||||
|
||||
pub async fn cli_download(
|
||||
@@ -426,6 +429,7 @@ pub async fn cli_download(
|
||||
ref id,
|
||||
target_version,
|
||||
dest,
|
||||
arch,
|
||||
}: CliDownloadParams,
|
||||
) -> Result<(), Error> {
|
||||
let progress_tracker = FullProgressTracker::new();
|
||||
@@ -473,6 +477,13 @@ pub async fn cli_download(
|
||||
res.best.remove(version).unwrap()
|
||||
}
|
||||
};
|
||||
if let Some(arch) = &arch {
|
||||
s9pk.retain(|(hw, _)| {
|
||||
hw.arch
|
||||
.as_ref()
|
||||
.map_or(true, |arches| arches.contains(arch))
|
||||
});
|
||||
}
|
||||
let s9pk = match s9pk.len() {
|
||||
0 => {
|
||||
return Err(Error::new(
|
||||
|
||||
Reference in New Issue
Block a user