mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-02 10:21:49 -05:00
makepkg: use regex to match options for privilege escalation
Eases maintanence if we need to add further options in the future. Extracted from a patch supplied by Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
48589ccc64
commit
298cbf2cb1
@ -372,7 +372,7 @@ download_file() {
|
||||
run_pacman() {
|
||||
local cmd
|
||||
printf -v cmd "%q " "$PACMAN" $PACMAN_OPTS "$@"
|
||||
if (( ! ASROOT )) && [[ $1 != "-T" && $1 != "-Qq" ]]; then
|
||||
if (( ! ASROOT )) && [[ ! $1 =~ ^-(T|Qq)$" ]]; then
|
||||
if [ "$(type -p sudo)" ]; then
|
||||
cmd="sudo $cmd"
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user