deb: resolve suite aliases in the target series
The changelog (and -s) may carry a suite name instead of the series codename: Debian conventionally writes 'unstable' where the series data carries 'sid'. The name was used verbatim downstream, so every NCR rebuild of a Debian package keyed its chroot tarball cache on 'unstable-buildd' (missing the cached sid tarball), tried to bootstrap a tarball nobody waits for, and finally died on 'Unknown series: unstable' in the distro-info lookup - with each queued build waiting out the 300s stale-lock grace on the way. Resolve the alias right where the series is picked, so the codename identifies the target everywhere downstream; the codename is also what the caches and distro-info data key on.
This commit is contained in:
+16
-7
@@ -297,20 +297,29 @@ async fn build_binary_package_impl(
|
||||
// UNRELEASED is not a real archive series: without an explicit --series,
|
||||
// build against the development series of the host vendor's distribution
|
||||
// instead. An explicit --series always wins.
|
||||
let resolved_series;
|
||||
let series = if let Some(s) = series {
|
||||
s
|
||||
let mut series = if let Some(s) = series {
|
||||
s.to_string()
|
||||
} else if crate::distro_info::is_unreleased(&package_series) {
|
||||
let dist = crate::build::env::current_vendor();
|
||||
resolved_series = crate::distro_info::effective_series(&package_series, &dist).await?;
|
||||
let series = crate::distro_info::effective_series(&package_series, &dist).await?;
|
||||
log::info!(
|
||||
"Changelog is UNRELEASED, building against series {}",
|
||||
resolved_series
|
||||
series
|
||||
);
|
||||
resolved_series.as_str()
|
||||
series
|
||||
} else {
|
||||
&package_series
|
||||
package_series.clone()
|
||||
};
|
||||
// A changelog (or an explicit --series) may carry a suite name instead of
|
||||
// the series codename: Debian conventionally writes 'unstable' where the
|
||||
// series data carries 'sid'. Resolve the alias so the codename identifies
|
||||
// the target everywhere downstream — the chroot bootstrap, the caches and
|
||||
// the distro-info lookups all key on codenames.
|
||||
if let Some((_, codename)) = crate::distro_info::resolve_suite_alias(&series) {
|
||||
log::info!("Suite '{}' resolved to series {}", series, codename);
|
||||
series = codename;
|
||||
}
|
||||
let series = series.as_str();
|
||||
let current_arch = crate::get_current_arch();
|
||||
let arch = arch.as_deref().unwrap_or(¤t_arch);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user