deb: add series, arch arguments
Some checks failed
CI / build (push) Failing after 29s

This commit is contained in:
2025-12-11 19:27:06 +01:00
parent fb9db10b0b
commit 659a8a2ba7
2 changed files with 23 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ use std::error::Error;
use std::path::Path;
use std::process::Command;
pub fn build_binary_package(cwd: Option<&Path>) -> Result<(), Box<dyn Error>> {
pub fn build_binary_package(arch: Option<&str>, series: Option<&str>, cwd: Option<&Path>) -> Result<(), Box<dyn Error>> {
let cwd = cwd.unwrap_or_else(|| Path::new("."));
// Parse changelog to get package name and version
@@ -19,7 +19,17 @@ pub fn build_binary_package(cwd: Option<&Path>) -> Result<(), Box<dyn Error>> {
println!("Building {} using sbuild...", dsc_path.display());
let status = Command::new("sbuild").arg(dsc_path).status()?;
let mut status = Command::new("sbuild");
if let Some(arch) = arch {
status.arg(format!("--arch={}", arch));
}
if let Some(series) = series {
status.arg(format!("--dist={}", series));
}
let status = status
.arg(dsc_path)
.status()?;
if !status.success() {
return Err(format!("sbuild failed with status: {}", status).into());