From 21e11151c884b5b0a1f4503cb2e904954c8b099a Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Sun, 14 Nov 2021 20:59:24 +0100 Subject: [PATCH] feat: support paru as AurHelper (#75) --- src/args.rs | 2 +- src/aur.rs | 20 +++++++++++++++++++- src/constants.rs | 1 - 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/args.rs b/src/args.rs index 5c360ac..ab8a0f4 100644 --- a/src/args.rs +++ b/src/args.rs @@ -84,7 +84,7 @@ pub struct CreateCommand { #[structopt(long = "allow-non-removable")] pub allow_non_removable: bool, - #[structopt(long = "aur-helper", possible_values=&["yay"], default_value="yay")] + #[structopt(long = "aur-helper", possible_values=&["paru", "yay"], default_value="yay")] pub aur_helper: AurHelper, } diff --git a/src/aur.rs b/src/aur.rs index 0aefa42..9ab3ef6 100644 --- a/src/aur.rs +++ b/src/aur.rs @@ -12,6 +12,25 @@ impl FromStr for AurHelper { fn from_str(s: &str) -> anyhow::Result { match s { + "paru" => Ok(Self { + name: String::from("paru"), + package_name: String::from("paru-bin"), + install_command: vec![ + String::from("paru"), + String::from("-S"), + String::from("--skipreview"), + String::from("--noupgrademenu"), + String::from("--useask"), + String::from("--removemake"), + String::from("--norebuild"), + String::from("--nocleanafter"), + String::from("--noredownload"), + String::from("--mflags"), + String::from(""), + String::from("--noconfirm"), + String::from("--batchinstall"), + ], + }), "yay" => Ok(Self { name: String::from("yay"), package_name: String::from("yay-bin"), @@ -25,7 +44,6 @@ impl FromStr for AurHelper { String::from("--useask"), String::from("--removemake"), String::from("--norebuild"), - String::from("--noconfirm"), String::from("--answeredit"), String::from("None"), String::from("--answerclean"), diff --git a/src/constants.rs b/src/constants.rs index b156ba0..b652191 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -9,5 +9,4 @@ SystemMaxUse=16M pub const BASE_PACKAGES: [&str; 1] = ["base"]; -// we add go so that it is cached when installing yay pub const AUR_DEPENDENCIES: [&str; 3] = ["base-devel", "git", "sudo"];