apt: refactor into multiple modules
Some checks failed
CI / build (push) Failing after 7m56s

This commit is contained in:
2026-01-09 18:02:22 +01:00
parent 1b659ce6f4
commit 464e25de24
4 changed files with 5 additions and 4 deletions

0
src/apt/keyring.rs Normal file
View File

1
src/apt/mod.rs Normal file
View File

@@ -0,0 +1 @@
pub mod sources;

View File

@@ -1,5 +1,5 @@
/// APT sources.list management
/// Provides a simple structure for managing APT repository sources
//! APT sources.list management
//! Provides a simple structure for managing APT repository sources
use crate::context;
use std::error::Error;
use std::path::Path;

View File

@@ -31,7 +31,7 @@ pub fn build(
}
// UBUNTU: Ensure 'universe' repository is enabled
let mut sources = apt::load(None)?;
let mut sources = apt::sources::load(None)?;
let mut modified = false;
for source in &mut sources {
if source.uri.contains("ubuntu") && !source.components.contains(&"universe".to_string()) {
@@ -40,7 +40,7 @@ pub fn build(
}
}
if modified {
apt::save_legacy(None, sources, "/etc/apt/sources.list")?;
apt::sources::save_legacy(None, sources, "/etc/apt/sources.list")?;
}
// Update package lists