distro_info: add UNRELEASED series handling, use it in deb and chlog

This commit is contained in:
2026-09-16 11:15:09 +02:00
parent 4af8dbddb0
commit ae420989f9
3 changed files with 116 additions and 5 deletions
+12
View File
@@ -83,8 +83,20 @@ async fn build_binary_package_impl(
let changelog_path = cwd.join("debian/changelog");
let (package, version, package_series) =
crate::changelog::parse_changelog_header(&changelog_path)?;
// 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
} 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?;
log::info!(
"Changelog is UNRELEASED, building against series {}",
resolved_series
);
resolved_series.as_str()
} else {
&package_series
};