diff options
author | Allan McRae <allan@archlinux.org> | 2010-08-05 20:44:34 +1000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-08-23 21:49:44 -0500 |
commit | 298cbf2cb152df365a593a396266636a9d34355f (patch) | |
tree | 62432f489393cf222b41379a30c8a834846113f6 /scripts | |
parent | 48589ccc64c5e7266f70c6294087e8b0450953e9 (diff) | |
download | pacman-298cbf2cb152df365a593a396266636a9d34355f.tar.xz |
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.in | 2 |
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 |