Add flatpak_systemwide option
This commit is contained in:
@@ -10,6 +10,7 @@ use crate::{impl_backend_constants, Group, Package};
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Flatpak {
|
||||
pub(crate) packages: HashSet<Package>,
|
||||
pub(crate) systemwide: bool,
|
||||
}
|
||||
|
||||
const BINARY: Text = "flatpak";
|
||||
@@ -43,6 +44,7 @@ impl Flatpak {
|
||||
pub(crate) fn new() -> Self {
|
||||
Self {
|
||||
packages: HashSet::new(),
|
||||
systemwide: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ pub struct Config {
|
||||
pub aur_helper: String,
|
||||
/// Additional arguments to pass to `aur_helper` when removing a package.
|
||||
pub aur_rm_args: Option<Vec<String>>,
|
||||
/// Install Flatpak packages system-wide
|
||||
pub flatpak_systemwide: bool,
|
||||
/// Warn the user when a group is not a symlink.
|
||||
pub warn_not_symlinks: bool,
|
||||
/// Backends the user does not want to use even though the binary exists.
|
||||
@@ -68,6 +70,7 @@ impl Default for Config {
|
||||
Self {
|
||||
aur_helper: "paru".into(),
|
||||
aur_rm_args: None,
|
||||
flatpak_systemwide: true,
|
||||
warn_not_symlinks: true,
|
||||
disabled_backends: vec![],
|
||||
}
|
||||
|
||||
@@ -128,6 +128,13 @@ impl Pacdef {
|
||||
arch.aur_rm_args = self.config.aur_rm_args.take();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "flatpak")]
|
||||
{
|
||||
if let Some(flatpak) = backend.as_any_mut().downcast_mut::<crate::backend::Flatpak>() {
|
||||
flatpak.systemwide = self.config.flatpak_systemwide;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn install_packages(&mut self, args: &ArgMatches) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user