rename backend from pacman to arch
This commit is contained in:
+4
-4
@@ -9,21 +9,21 @@ use crate::backend::backend_trait::{Backend, Switches, Text};
|
||||
use crate::{impl_backend_constants, Group, Package};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Pacman {
|
||||
pub struct Arch {
|
||||
pub(crate) binary: String,
|
||||
pub(crate) aur_rm_args: Option<Vec<String>>,
|
||||
pub(crate) packages: HashSet<Package>,
|
||||
}
|
||||
|
||||
const BINARY: Text = "paru";
|
||||
const SECTION: Text = "pacman";
|
||||
const SECTION: Text = "arch";
|
||||
|
||||
const SWITCHES_INFO: Switches = &["--query", "--info"];
|
||||
const SWITCHES_INSTALL: Switches = &["--sync"];
|
||||
const SWITCHES_MAKE_DEPENDENCY: Switches = &["--database", "--asdeps"];
|
||||
const SWITCHES_REMOVE: Switches = &["--remove", "--recursive"];
|
||||
|
||||
impl Backend for Pacman {
|
||||
impl Backend for Arch {
|
||||
impl_backend_constants!();
|
||||
|
||||
fn get_all_installed_packages(&self) -> Result<HashSet<Package>> {
|
||||
@@ -104,7 +104,7 @@ fn get_db_handle() -> Result<Alpm> {
|
||||
Alpm::new("/", "/var/lib/pacman").context("connecting to DB using expected default values")
|
||||
}
|
||||
|
||||
impl Pacman {
|
||||
impl Arch {
|
||||
pub(crate) fn new() -> Self {
|
||||
Self {
|
||||
binary: BINARY.to_string(),
|
||||
@@ -1,2 +1,2 @@
|
||||
pub mod pacman;
|
||||
pub mod arch;
|
||||
pub mod rust;
|
||||
|
||||
@@ -12,6 +12,6 @@ use pacdef_macros::Register;
|
||||
|
||||
#[derive(Debug, Register)]
|
||||
pub enum Backends {
|
||||
Pacman,
|
||||
Arch,
|
||||
Rust,
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ impl Pacdef {
|
||||
}
|
||||
|
||||
fn overwrite_values_from_config(&mut self, backend: Box<dyn Backend>) -> Box<dyn Backend> {
|
||||
if backend.get_section() == "pacman" {
|
||||
Box::new(crate::backend::Pacman {
|
||||
if backend.get_section() == "arch" {
|
||||
Box::new(crate::backend::Arch {
|
||||
binary: self.config.aur_helper.clone(),
|
||||
aur_rm_args: self.config.aur_rm_args.take(),
|
||||
packages: HashSet::new(),
|
||||
|
||||
Reference in New Issue
Block a user