deb: ensure universe is enabled on Ubuntu by default
Some checks failed
CI / build (push) Has been cancelled

Added apt source parser, module apt
This commit is contained in:
2026-01-08 18:15:50 +01:00
parent f3f78ef0e3
commit 126a6e0d76
3 changed files with 335 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ use std::collections::HashMap;
use std::error::Error;
use std::path::Path;
use crate::apt;
use crate::deb::cross;
pub fn build(
@@ -29,6 +30,19 @@ pub fn build(
cross::ensure_repositories(arch, series)?;
}
// UBUNTU: Ensure 'universe' repository is enabled
let mut sources = apt::load(None)?;
let mut modified = false;
for source in &mut sources {
if source.uri.contains("ubuntu") && !source.components.contains(&"universe".to_string()) {
source.components.push("universe".to_string());
modified = true;
}
}
if modified {
apt::save_legacy(None, sources, "/etc/apt/sources.list")?;
}
// Update package lists
log::debug!("Updating package lists for local build...");
let status = ctx