fix: debian without bindings
reimplemented parts of the Debian backend to get rid of the apt library that has a different version everywhere and therefore won't play nicely with our pacdef
This commit is contained in:
Generated
-142
@@ -92,16 +92,6 @@ version = "2.11.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
|
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cc"
|
|
||||||
version = "1.2.61"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d"
|
|
||||||
dependencies = [
|
|
||||||
"find-msvc-tools",
|
|
||||||
"shlex",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.6.1"
|
version = "4.6.1"
|
||||||
@@ -142,17 +132,6 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "codespan-reporting"
|
|
||||||
version = "0.13.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681"
|
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
"termcolor",
|
|
||||||
"unicode-width",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "colorchoice"
|
name = "colorchoice"
|
||||||
version = "1.0.5"
|
version = "1.0.5"
|
||||||
@@ -180,68 +159,6 @@ dependencies = [
|
|||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cxx"
|
|
||||||
version = "1.0.194"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "747d8437319e3a2f43d93b341c137927ca70c0f5dabeea7a005a73665e247c7e"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"cxx-build",
|
|
||||||
"cxxbridge-cmd",
|
|
||||||
"cxxbridge-flags",
|
|
||||||
"cxxbridge-macro",
|
|
||||||
"foldhash",
|
|
||||||
"link-cplusplus",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cxx-build"
|
|
||||||
version = "1.0.194"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b0f4697d190a142477b16aef7da8a99bfdc41e7e8b1687583c0d23a79c7afc1e"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"codespan-reporting",
|
|
||||||
"indexmap",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"scratch",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cxxbridge-cmd"
|
|
||||||
version = "1.0.194"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d0956799fa8678d4c50eed028f2de1c0552ae183c76e976cf7ca8c4e36a7c328"
|
|
||||||
dependencies = [
|
|
||||||
"clap",
|
|
||||||
"codespan-reporting",
|
|
||||||
"indexmap",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cxxbridge-flags"
|
|
||||||
version = "1.0.194"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "23384a836ab4f0ad98ace7e3955ad2de39de42378ab487dc28d3990392cb283a"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cxxbridge-macro"
|
|
||||||
version = "1.0.194"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e6acc6b5822b9526adfb4fc377b67128fdd60aac757cc4a741a6278603f763cf"
|
|
||||||
dependencies = [
|
|
||||||
"indexmap",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "enum_dispatch"
|
name = "enum_dispatch"
|
||||||
version = "0.3.13"
|
version = "0.3.13"
|
||||||
@@ -260,18 +177,6 @@ version = "1.0.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "find-msvc-tools"
|
|
||||||
version = "0.1.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "foldhash"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.17.0"
|
version = "0.17.0"
|
||||||
@@ -327,15 +232,6 @@ version = "0.2.186"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "link-cplusplus"
|
|
||||||
version = "1.0.12"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7f78c730aaa7d0b9336a299029ea49f9ee53b0ed06e9202e8cb7db9bae7b8c82"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.29"
|
version = "0.4.29"
|
||||||
@@ -373,7 +269,6 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"path-absolutize",
|
"path-absolutize",
|
||||||
"regex",
|
"regex",
|
||||||
"rust-apt",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"termios",
|
"termios",
|
||||||
@@ -452,16 +347,6 @@ version = "0.8.10"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rust-apt"
|
|
||||||
version = "0.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "eed4919c373ded6983386cf3eedc0ec7a6005e2da17dc719805cb536925fdc07"
|
|
||||||
dependencies = [
|
|
||||||
"cxx",
|
|
||||||
"cxx-build",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "same-file"
|
name = "same-file"
|
||||||
version = "1.0.6"
|
version = "1.0.6"
|
||||||
@@ -471,12 +356,6 @@ dependencies = [
|
|||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "scratch"
|
|
||||||
version = "1.0.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d68f2ec51b097e4c1a75b681a8bec621909b5e91f15bb7b840c4f2f7b01148b2"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.228"
|
version = "1.0.228"
|
||||||
@@ -529,12 +408,6 @@ dependencies = [
|
|||||||
"serde_core",
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "shlex"
|
|
||||||
version = "1.3.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
@@ -552,15 +425,6 @@ dependencies = [
|
|||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "termcolor"
|
|
||||||
version = "1.4.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
|
|
||||||
dependencies = [
|
|
||||||
"winapi-util",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termios"
|
name = "termios"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
@@ -615,12 +479,6 @@ version = "1.0.24"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "unicode-width"
|
|
||||||
version = "0.2.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
version = "0.2.6"
|
version = "0.2.6"
|
||||||
|
|||||||
+2
-2
@@ -29,12 +29,12 @@ toml = "0.9"
|
|||||||
|
|
||||||
# backends
|
# backends
|
||||||
alpm = { version = "5.0", optional = true }
|
alpm = { version = "5.0", optional = true }
|
||||||
rust-apt = { version = "0.9", optional = true}
|
#rust-apt = { version = "0.9", optional = true}
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
arch = ["dep:alpm"]
|
arch = ["dep:alpm"]
|
||||||
debian = ["dep:rust-apt"]
|
#debian = ["dep:rust-apt"]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = "off"
|
lto = "off"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
use std::process::Command;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use rust_apt::cache::PackageSort;
|
|
||||||
use rust_apt::new_cache;
|
|
||||||
|
|
||||||
use crate::backend::root::build_base_command_with_privileges;
|
use crate::backend::root::build_base_command_with_privileges;
|
||||||
use crate::cmd::run_external_command;
|
use crate::cmd::run_external_command;
|
||||||
@@ -33,25 +33,21 @@ impl Backend for Debian {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_all_installed_packages(&self) -> Result<Packages> {
|
fn get_all_installed_packages(&self) -> Result<Packages> {
|
||||||
let cache = new_cache!()?;
|
let mut cmd = Command::new("apt");
|
||||||
let sort = PackageSort::default().installed();
|
cmd.args(&["list", "--installed"]);
|
||||||
|
|
||||||
let mut result = Packages::new();
|
let output = String::from_utf8(cmd.output()?.stdout)?;
|
||||||
for pkg in cache.packages(&sort) {
|
|
||||||
result.insert(Package::from(pkg.name().to_string()));
|
output_to_packages(output)
|
||||||
}
|
|
||||||
Ok(result)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_explicitly_installed_packages(&self) -> Result<Packages> {
|
fn get_explicitly_installed_packages(&self) -> Result<Packages> {
|
||||||
let cache = new_cache!()?;
|
let mut cmd = Command::new("apt-mark");
|
||||||
let sort = PackageSort::default().installed().manually_installed();
|
cmd.args(&["showmanual"]);
|
||||||
|
|
||||||
let mut result = Packages::new();
|
let output = String::from_utf8(cmd.output()?.stdout)?;
|
||||||
for pkg in cache.packages(&sort) {
|
|
||||||
result.insert(Package::from(pkg.name().to_string()));
|
output_to_packages(output)
|
||||||
}
|
|
||||||
Ok(result)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_dependency(&self, packages: &Packages) -> Result<()> {
|
fn make_dependency(&self, packages: &Packages) -> Result<()> {
|
||||||
@@ -101,3 +97,11 @@ impl Backend for Debian {
|
|||||||
run_external_command(cmd)
|
run_external_command(cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn output_to_packages(output: String) -> Result<Packages> {
|
||||||
|
let mut result = Packages::new();
|
||||||
|
for line in output.lines() {
|
||||||
|
result.insert(Package::from(line));
|
||||||
|
}
|
||||||
|
Ok(result)
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#[cfg(feature = "arch")]
|
#[cfg(feature = "arch")]
|
||||||
pub mod arch;
|
pub mod arch;
|
||||||
#[cfg(feature = "debian")]
|
|
||||||
pub mod debian;
|
pub mod debian;
|
||||||
pub mod fedora;
|
pub mod fedora;
|
||||||
pub mod flatpak;
|
pub mod flatpak;
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ impl ManagedBackend {
|
|||||||
pub enum AnyBackend {
|
pub enum AnyBackend {
|
||||||
#[cfg(feature = "arch")]
|
#[cfg(feature = "arch")]
|
||||||
Arch(actual::arch::Arch),
|
Arch(actual::arch::Arch),
|
||||||
#[cfg(feature = "debian")]
|
|
||||||
Debian(actual::debian::Debian),
|
Debian(actual::debian::Debian),
|
||||||
Flatpak(Flatpak),
|
Flatpak(Flatpak),
|
||||||
Fedora(Fedora),
|
Fedora(Fedora),
|
||||||
@@ -70,7 +69,6 @@ impl AnyBackend {
|
|||||||
vec![
|
vec![
|
||||||
#[cfg(feature = "arch")]
|
#[cfg(feature = "arch")]
|
||||||
Self::Arch(actual::arch::Arch::new(config)),
|
Self::Arch(actual::arch::Arch::new(config)),
|
||||||
#[cfg(feature = "debian")]
|
|
||||||
Self::Debian(actual::debian::Debian::new()),
|
Self::Debian(actual::debian::Debian::new()),
|
||||||
Self::Flatpak(Flatpak::new(config)),
|
Self::Flatpak(Flatpak::new(config)),
|
||||||
Self::Fedora(Fedora::new()),
|
Self::Fedora(Fedora::new()),
|
||||||
@@ -86,7 +84,6 @@ impl AnyBackend {
|
|||||||
match section {
|
match section {
|
||||||
#[cfg(feature = "arch")]
|
#[cfg(feature = "arch")]
|
||||||
"arch" => Ok(Self::Arch(actual::arch::Arch::new(config))),
|
"arch" => Ok(Self::Arch(actual::arch::Arch::new(config))),
|
||||||
#[cfg(feature = "debian")]
|
|
||||||
"debian" => Ok(Self::Debian(actual::debian::Debian::new())),
|
"debian" => Ok(Self::Debian(actual::debian::Debian::new())),
|
||||||
"flatpak" => Ok(Self::Flatpak(Flatpak::new(config))),
|
"flatpak" => Ok(Self::Flatpak(Flatpak::new(config))),
|
||||||
"fedora" => Ok(Self::Fedora(Fedora::new())),
|
"fedora" => Ok(Self::Fedora(Fedora::new())),
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use anyhow::{ensure, Context, Result};
|
use anyhow::{Context, Result, ensure};
|
||||||
|
|
||||||
use crate::env::{get_editor, should_print_debug_info};
|
use crate::env::{get_editor, should_print_debug_info};
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -1,14 +1,13 @@
|
|||||||
|
pub use crate::backend::AnyBackend;
|
||||||
|
pub use crate::backend::ManagedBackend;
|
||||||
#[cfg(feature = "arch")]
|
#[cfg(feature = "arch")]
|
||||||
pub use crate::backend::actual::arch::Arch;
|
pub use crate::backend::actual::arch::Arch;
|
||||||
#[cfg(feature = "debian")]
|
|
||||||
pub use crate::backend::actual::debian::Debian;
|
pub use crate::backend::actual::debian::Debian;
|
||||||
pub use crate::backend::actual::{
|
pub use crate::backend::actual::{
|
||||||
fedora::Fedora, flatpak::Flatpak, python::Python, rust::Rust, rustup::Rustup, void::Void,
|
fedora::Fedora, flatpak::Flatpak, python::Python, rust::Rust, rustup::Rustup, void::Void,
|
||||||
};
|
};
|
||||||
pub use crate::backend::backend_trait::{Backend, BackendInfo, Switches, Text};
|
pub use crate::backend::backend_trait::{Backend, BackendInfo, Switches, Text};
|
||||||
pub use crate::backend::todo_per_backend::ToDoPerBackend;
|
pub use crate::backend::todo_per_backend::ToDoPerBackend;
|
||||||
pub use crate::backend::AnyBackend;
|
|
||||||
pub use crate::backend::ManagedBackend;
|
|
||||||
pub use crate::cli::CleanPackageAction;
|
pub use crate::cli::CleanPackageAction;
|
||||||
pub use crate::cli::EditGroupAction;
|
pub use crate::cli::EditGroupAction;
|
||||||
pub use crate::cli::ExportGroupAction;
|
pub use crate::cli::ExportGroupAction;
|
||||||
|
|||||||
Reference in New Issue
Block a user