deb: match archive sources and the universe gate through the distro mirror data
This commit is contained in:
+15
-5
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user