rename backend from pacman to arch
This commit is contained in:
@@ -6,14 +6,12 @@ multi-backend declarative package manager for Linux
|
||||
|
||||
## Use-case
|
||||
`pacdef` allows the user to have consistent packages among multiple Linux machines by managing packages in group files.
|
||||
The group files are maintained outside of `pacdef` by any VCS.
|
||||
|
||||
`pacdef import`ing a package group file creates a symlink to that file in `pacdef`'s config dir, thereby letting `pacdef` know you want to have the packages in this file on your machine.
|
||||
Then installing all packages from all groups is as simple as `pacdef sync`.
|
||||
All package operations are executed by the respective package managers.
|
||||
The group files are maintained outside of `pacdef` by any VCS, like git.
|
||||
|
||||
If you work with multiple Linux machines and have asked yourself "*Why do I have the program that I use every day on my other machine not installed here?*", then `pacdef` is the tool for you.
|
||||
|
||||
|
||||
|
||||
## Supported backends
|
||||
At the moment, supported backends are limited to the following.
|
||||
|
||||
@@ -68,6 +66,10 @@ Usage on different machines:
|
||||
* search for the group that contains a package: `pacdef search firefox`
|
||||
* show packages of a group: `pacdef show desktop`
|
||||
|
||||
`pacdef import`ing a package group file creates a symlink to that file in `pacdef`'s config dir, thereby letting `pacdef` know you want to have the packages in this file on your machine.
|
||||
Then installing all packages from all groups is as simple as `pacdef sync`.
|
||||
All package operations are executed by the respective package managers.
|
||||
|
||||
|
||||
### Configuration
|
||||
|
||||
|
||||
+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