exp: cross #6

This commit is contained in:
2025-12-22 23:08:44 +01:00
parent 63389f0bad
commit 3ecfe6dda2
6 changed files with 101 additions and 16 deletions

View File

@@ -1,21 +1,19 @@
/// Sbuild binary package building
/// Call 'sbuild' with the dsc file to build the package with unshare
use crate::context;
use crate::deb::find_dsc_file;
use std::error::Error;
pub fn build(
package: &str,
version: &str,
_version: &str,
arch: &str,
series: &str,
build_root: &str,
cross: bool,
) -> Result<(), Box<dyn Error>> {
let dsc_path = find_dsc_file(build_root, package, version)?;
let ctx = context::current();
let mut cmd = ctx.command("sbuild");
cmd.current_dir(format!("{}/{}", build_root, package));
cmd.arg("--chroot-mode=unshare");
if cross {
@@ -28,8 +26,7 @@ pub fn build(
// Add output directory argument
cmd.arg(format!("--build-dir={}", build_root));
let status = cmd.arg(dsc_path).status()?;
let status = cmd.status()?;
if !status.success() {
return Err(format!("sbuild failed with status: {}", status).into());
}