From 298cbf2cb152df365a593a396266636a9d34355f Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 5 Aug 2010 20:44:34 +1000 Subject: 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 Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 1b788efd..2336e337 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -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 -- cgit v1.2.3-54-g00ecf