diff --git a/completions/bash b/completions/bash index 22fdff94..038ad5a1 100644 --- a/completions/bash +++ b/completions/bash @@ -75,7 +75,8 @@ _paru() { rebuildtree redownload noredownload redownloadall pgpfetch nopgpfetch useask nouseask combinedupgrade nocombinedupgrade batchinstall nobatchinstall provides noprovides devel nodevel develsuffixes sudoloop nosudoloop bottomup topdown - newsonupgrade bat batflags chroot nochroot localrepo' 'b d h q r v a') + newsonupgrade bat batflags chroot nochroot localrepo review skipreview' + 'b d h q r v a') show=('news' 'w') getpkgbuild=('print comments' 'p c') diff --git a/completions/fish b/completions/fish index d65f7952..16e716b3 100644 --- a/completions/fish +++ b/completions/fish @@ -232,3 +232,5 @@ complete -c $progname -n "not $noopt" -l nosudoloop -d 'Do not loop sudo calls i complete -c $progname -n "not $noopt" -l chroot -d 'Build packages in a chroot' -f complete -c $progname -n "not $noopt" -l nochroot -d "Don't build packages in a chroot" -f complete -c $progname -n "not $noopt" -l localrepo -d 'Build packages in a local repo' -f +complete -c $progname -n "not $noopt" -l skipreview -d 'Skip the review process' -f +complete -c $progname -n "not $noopt" -l review -d "Don't kip the review process" -f diff --git a/completions/zsh b/completions/zsh index 959979df..b8c54fb6 100644 --- a/completions/zsh +++ b/completions/zsh @@ -101,6 +101,9 @@ _pacman_opts_common=( '--chroot[Build packages in a chroot]' "--nochroot[Don't build packages in a chroot]" '--localrepo[Build packages in a local repo]' + + '--upgrademenu[Skip the review process]' + "--upgrademenu[Don't skip the review process]" ) # options for passing to _arguments: options for --upgrade commands diff --git a/help b/help index 5e503c2d..cbd4d71b 100644 --- a/help +++ b/help @@ -49,6 +49,8 @@ New options: --sortby Sort AUR results by a specific field during search --searchby Search for packages using a specified field + --skipreview Skip the review process + --noskipreview Don't skip the review process --[no]upgrademenu Show interactive menu to skip upgrades --[no]removemake Remove makedepends after install --[no]cleanafter Remove package sources after successful install diff --git a/man/paru.8 b/man/paru.8 index ab5556ef..78138778 100644 --- a/man/paru.8 +++ b/man/paru.8 @@ -260,7 +260,15 @@ Sort AUR results by a specific field during search. Defaults to votes. Search for AUR packages by querying the specified field. Defaults to name-desc. .TP -.B \-\-[no]upgrademenu +.B \-\-skipreview +Skip the review process. + +.TP +.B \-\-review +Don't skip the review process. + +.TP +.B \-\-upgrademenu Show a detailed list of updates in a similar format to pacman's VerbosePkgLists option. (See .BR pacman.conf(5)). diff --git a/man/paru.conf.5 b/man/paru.conf.5 index c9ca83ee..25103d03 100644 --- a/man/paru.conf.5 +++ b/man/paru.conf.5 @@ -201,6 +201,10 @@ in other enabled repos. Build packages in a chroot. This rquires the LocalRepo option to be enabled. Optionaly a directory may be passed to specify where the create the chroot. +.TP +.B SkipReview +Skip the review process. + .SH BIN Options belonging to the [bin] section. diff --git a/src/command_line.rs b/src/command_line.rs index 2c33ee3f..1d50a042 100644 --- a/src/command_line.rs +++ b/src/command_line.rs @@ -232,6 +232,8 @@ impl Config { self.aur_filter = true; } Arg::Long("repo") => self.mode = "repo".to_string(), + Arg::Long("skipreview") => self.skip_review = true, + Arg::Long("review") => self.skip_review = false, Arg::Long("gendb") => self.gendb = true, Arg::Long("nocheck") => self.no_check = true, Arg::Long("devel") => self.devel = true, diff --git a/src/config.rs b/src/config.rs index c817d55d..3bcf019a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -196,6 +196,7 @@ pub struct Config { pub help: bool, pub version: bool, + pub skip_review: bool, pub no_check: bool, pub no_confirm: bool, pub devel: bool, @@ -640,6 +641,7 @@ impl Config { let mut ok2 = true; match key { + "SkipReview" => self.skip_review = true, "BottomUp" => self.sort_mode = "bottomup".into(), "AurOnly" => self.mode = "aur".into(), "RepoOnly" => self.mode = "repo".into(), diff --git a/src/install.rs b/src/install.rs index 93f07389..5982d6f0 100644 --- a/src/install.rs +++ b/src/install.rs @@ -16,12 +16,12 @@ use crate::{args, exec, news}; use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet}; use std::env::var; +use std::ffi::OsStr; use std::fs::{read_dir, read_link, OpenOptions}; use std::io::{stdin, stdout, BufRead, Read, Write}; use std::iter::FromIterator; use std::path::Path; use std::process::{Command, Stdio}; -use std::ffi::OsStr; use alpm::Alpm; use alpm_utils::{DbListExt, Targ}; @@ -196,16 +196,24 @@ pub async fn install(config: &mut Config, targets_str: &[String]) -> Result false }; - if !ask(config, "Proceed to review?", true) { - return Ok(1); + if !config.skip_review { + if !ask(config, "Proceed to review?", true) { + return Ok(1); + } + } else { + if !ask(config, "Proceed with install?", true) { + return Ok(1); + } } let bases = Bases::from_iter(actions.iter_build_pkgs().map(|p| p.pkg.clone())); let srcinfos = download_pkgbuilds(config, &bases).await?; - let ret = review(config, &actions, &srcinfos, &bases)?; - if ret != 0 { - return Ok(ret); + if !config.skip_review { + let ret = review(config, &actions, &srcinfos, &bases)?; + if ret != 0 { + return Ok(ret); + } } let mut err = if !config.chroot { @@ -379,16 +387,19 @@ fn review<'a>( { let file = file?; - if file.file_type()?.is_dir() && file.path().file_name() == Some(OsStr::new(".git")) { + if file.file_type()?.is_dir() + && file.path().file_name() == Some(OsStr::new(".git")) + { continue; } - if file.file_type()?.is_dir() && file.path().file_name() == Some(OsStr::new(".SRCINFO")) { + if file.file_type()?.is_dir() + && file.path().file_name() == Some(OsStr::new(".SRCINFO")) + { continue; } if file.file_type()?.is_dir() { let s = format!("{} is a directory\n\n", file.path().display()); - let _ = - write!(stdin, "{}", c.bold.paint(s)); + let _ = write!(stdin, "{}", c.bold.paint(s)); continue; } if file.file_type()?.is_symlink() { @@ -401,7 +412,11 @@ fn review<'a>( continue; } - let _ = write!(stdin, "{}\n", c.bold.paint(file.path().display().to_string())); + let _ = write!( + stdin, + "{}\n", + c.bold.paint(file.path().display().to_string()) + ); if bat { let output = Command::new(&config.bat_bin) .arg("-pp")