add option to disable backends
This commit is contained in:
@@ -14,6 +14,8 @@ pub struct Config {
|
|||||||
pub aur_rm_args: Option<Vec<String>>,
|
pub aur_rm_args: Option<Vec<String>>,
|
||||||
/// Warn the user when a group is not a symlink.
|
/// Warn the user when a group is not a symlink.
|
||||||
pub warn_not_symlinks: bool,
|
pub warn_not_symlinks: bool,
|
||||||
|
/// Backends the user does not want to use even though the binary exists.
|
||||||
|
pub disabled_backends: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
@@ -65,6 +67,7 @@ impl Default for Config {
|
|||||||
aur_helper: "paru".into(),
|
aur_helper: "paru".into(),
|
||||||
aur_rm_args: None,
|
aur_rm_args: None,
|
||||||
warn_not_symlinks: true,
|
warn_not_symlinks: true,
|
||||||
|
disabled_backends: vec![],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,9 +95,15 @@ impl Pacdef {
|
|||||||
let mut to_install = ToDoPerBackend::new();
|
let mut to_install = ToDoPerBackend::new();
|
||||||
|
|
||||||
for mut backend in Backends::iter() {
|
for mut backend in Backends::iter() {
|
||||||
#[cfg(feature = "arch")]
|
if self
|
||||||
self.overwrite_values_from_config(&mut *backend);
|
.config
|
||||||
|
.disabled_backends
|
||||||
|
.contains(&backend.get_section().to_string())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.overwrite_values_from_config(&mut *backend);
|
||||||
backend.load(&self.groups);
|
backend.load(&self.groups);
|
||||||
|
|
||||||
match backend.get_missing_packages_sorted() {
|
match backend.get_missing_packages_sorted() {
|
||||||
@@ -172,9 +178,15 @@ impl Pacdef {
|
|||||||
let mut result = ToDoPerBackend::new();
|
let mut result = ToDoPerBackend::new();
|
||||||
|
|
||||||
for mut backend in Backends::iter() {
|
for mut backend in Backends::iter() {
|
||||||
#[cfg(feature = "arch")]
|
if self
|
||||||
self.overwrite_values_from_config(&mut *backend);
|
.config
|
||||||
|
.disabled_backends
|
||||||
|
.contains(&backend.get_section().to_string())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.overwrite_values_from_config(&mut *backend);
|
||||||
backend.load(&self.groups);
|
backend.load(&self.groups);
|
||||||
|
|
||||||
match backend.get_unmanaged_packages_sorted() {
|
match backend.get_unmanaged_packages_sorted() {
|
||||||
|
|||||||
Reference in New Issue
Block a user