pull,deb: add top-level --pocket option
CI / build (push) Failing after 2m31s
CI / snap (push) Skipped

- pull: select the pocket to download the source package from
- deb: build against dependencies from a specific pocket:
  - local mode: enable '{series}-{pocket}' suite on archive sources
  - cross mode: include the pocket suite in required repositories
This commit is contained in:
2026-08-22 12:02:05 +02:00
parent ec77bc6d4d
commit f54be8ad8c
5 changed files with 61 additions and 10 deletions
+15 -1
View File
@@ -17,6 +17,7 @@ pub async fn build(
version: &str,
arch: &str,
series: &str,
pocket: Option<&str>,
build_root: &str,
cross: bool,
ppa: Option<&[&str]>,
@@ -53,7 +54,7 @@ pub async fn build(
if cross {
log::debug!("Setting up environment for local cross build...");
cross::setup_environment(&mut env, arch, ctx.clone())?;
cross::ensure_repositories(arch, series, ctx.clone())?;
cross::ensure_repositories(arch, series, pocket, ctx.clone())?;
}
let mut sources = apt::sources::load(Some(ctx.clone()))?;
@@ -116,6 +117,19 @@ pub async fn build(
}
}
// Enable the requested pocket on archive sources, so build-dependencies
// are resolved from that pocket
if let Some(pocket_name) = pocket {
let pocket_suite = format!("{series}-{pocket_name}");
log::info!("Enabling pocket '{}' for build dependencies", pocket_suite);
for source in &mut sources {
if crate::deb::is_archive_source(&source.uri) && !source.suite.contains(&pocket_suite) {
source.suite.push(pocket_suite.clone());
modified = true;
}
}
}
if modified {
apt::sources::save_legacy(Some(ctx.clone()), sources, "/etc/apt/sources.list")?;