deb: ensure universe is enabled on Ubuntu by default
Some checks failed
CI / build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
Added apt source parser, module apt
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user