This commit is contained in:
0
src/apt/keyring.rs
Normal file
0
src/apt/keyring.rs
Normal file
1
src/apt/mod.rs
Normal file
1
src/apt/mod.rs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pub mod sources;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/// APT sources.list management
|
//! APT sources.list management
|
||||||
/// Provides a simple structure for managing APT repository sources
|
//! Provides a simple structure for managing APT repository sources
|
||||||
use crate::context;
|
use crate::context;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@@ -31,7 +31,7 @@ pub fn build(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UBUNTU: Ensure 'universe' repository is enabled
|
// UBUNTU: Ensure 'universe' repository is enabled
|
||||||
let mut sources = apt::load(None)?;
|
let mut sources = apt::sources::load(None)?;
|
||||||
let mut modified = false;
|
let mut modified = false;
|
||||||
for source in &mut sources {
|
for source in &mut sources {
|
||||||
if source.uri.contains("ubuntu") && !source.components.contains(&"universe".to_string()) {
|
if source.uri.contains("ubuntu") && !source.components.contains(&"universe".to_string()) {
|
||||||
@@ -40,7 +40,7 @@ pub fn build(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if modified {
|
if modified {
|
||||||
apt::save_legacy(None, sources, "/etc/apt/sources.list")?;
|
apt::sources::save_legacy(None, sources, "/etc/apt/sources.list")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update package lists
|
// Update package lists
|
||||||
|
|||||||
Reference in New Issue
Block a user