update dependencies, fix integration

This commit is contained in:
steven-omaha
2026-04-29 17:35:41 +02:00
parent 83275576fb
commit 86e28d4a0a
6 changed files with 179 additions and 404 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ impl Backend for Debian {
let sort = PackageSort::default().installed();
let mut result = Packages::new();
for pkg in cache.packages(&sort)? {
for pkg in cache.packages(&sort) {
result.insert(Package::from(pkg.name().to_string()));
}
Ok(result)
@@ -48,7 +48,7 @@ impl Backend for Debian {
let sort = PackageSort::default().installed().manually_installed();
let mut result = Packages::new();
for pkg in cache.packages(&sort)? {
for pkg in cache.packages(&sort) {
result.insert(Package::from(pkg.name().to_string()));
}
Ok(result)
+2 -3
View File
@@ -6,12 +6,11 @@ pub fn we_are_root() -> bool {
}
pub fn build_base_command_with_privileges(binary: &str) -> Command {
let cmd = if we_are_root() {
if we_are_root() {
Command::new(binary)
} else {
let mut cmd = Command::new("sudo");
cmd.arg(binary);
cmd
};
cmd
}
}
+4 -9
View File
@@ -1,6 +1,6 @@
use std::collections::{BTreeMap, BTreeSet};
use std::fmt::Display;
use std::fs::{create_dir, read_to_string, File};
use std::fs::{File, create_dir, read_to_string};
use std::hash::Hash;
use std::io::Write;
use std::path::{Path, PathBuf};
@@ -99,14 +99,11 @@ fn is_child_of_any_dir(path: &Path, dirs: &[PathBuf]) -> bool {
// pair `path` with every item from `symlink_dirs`
.zip([path].iter().cycle())
// for every pair, test if all path elements of the dir are present in the file path
.map(|(dir, file)| {
.any(|(dir, file)| {
dir.iter()
.zip(file.iter())
.map(|(dir_elem, file_elem)| dir_elem == file_elem)
.all(|path_element_equal| path_element_equal)
.all(|(dir_elem, file_elem)| dir_elem == file_elem)
})
// it suffices if that holds for any of the generated pairs
.any(|is_child| is_child)
}
impl PartialOrd for Group {
@@ -133,9 +130,7 @@ impl PartialEq for Group {
}
}
impl Eq for Group {
fn assert_receiver_is_total_eq(&self) {}
}
impl Eq for Group {}
impl Group {
/// Load the group from `path`. Determine the name from the path relative to the
+2 -4
View File
@@ -3,7 +3,7 @@ use std::fmt::{Display, Write};
use std::hash::Hash;
use std::iter::Peekable;
use anyhow::{ensure, Context, Result};
use anyhow::{Context, Result, ensure};
use crate::prelude::*;
@@ -81,9 +81,7 @@ impl PartialEq for Section {
}
}
impl Eq for Section {
fn assert_receiver_is_total_eq(&self) {}
}
impl Eq for Section {}
impl PartialOrd for Section {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {