deb: match archive sources and the universe gate through the distro mirror data

This commit is contained in:
2026-09-18 13:57:22 +02:00
parent b8b2be5acf
commit 52d5ad064f
2 changed files with 48 additions and 10 deletions
+15 -5
View File
@@ -135,11 +135,21 @@ pub async fn build(
}
}
// UBUNTU: Ensure 'universe' repository is enabled
for source in &mut sources {
if source.uri.contains("ubuntu") && !source.components.contains(&"universe".to_string()) {
source.components.push("universe".to_string());
modified = true;
// UBUNTU: Ensure the 'universe' component is enabled on official
// Ubuntu sources (many build dependencies live there). The old
// `uri.contains("ubuntu")` gate also caught third-party repositories
// whose URL merely mentions Ubuntu; the mirror-data check leaves them
// alone. 'universe' is only added when Ubuntu's component list still
// carries it.
let ubuntu_components = crate::distro_info::get_dist_components("ubuntu")?;
if ubuntu_components.iter().any(|c| c == "universe") {
for source in &mut sources {
if crate::distro_info::is_official_source("ubuntu", &source.uri)
&& !source.components.contains(&"universe".to_string())
{
source.components.push("universe".to_string());
modified = true;
}
}
}