Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2010-08-05 20:44:34 +1000
committerDan McGee <dan@archlinux.org>2010-08-23 21:49:44 -0500
commit298cbf2cb152df365a593a396266636a9d34355f (patch)
tree62432f489393cf222b41379a30c8a834846113f6 /scripts
parent48589ccc64c5e7266f70c6294087e8b0450953e9 (diff)
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in2
1 files changed, 1 insertions, 1 deletions
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