summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-01 03:55:44 +0100
committerDan McGee <dan@archlinux.org>2012-03-09 00:30:15 +0100
commit8d26df5ee53d9fb4d2c7be97b7f099e3e8402186 (patch)
tree701d57ede5fe17ec1a422348802344286618c4f3
parent708a227578a8d27bb84dd150fec9c2ebc1afd117 (diff)
downloadpacman-8d26df5ee53d9fb4d2c7be97b7f099e3e8402186.tar.gz
pacman-8d26df5ee53d9fb4d2c7be97b7f099e3e8402186.tar.xz
makepkg: avoid use of eval in run_pacman
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 14e2f6a0..1d906ba1 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -415,18 +415,18 @@ download_file() {
run_pacman() {
local cmd
if [[ ! $1 = -@(T|Qq) ]]; then
- printf -v cmd "%q " "$PACMAN" $PACMAN_OPTS "$@"
+ cmd=("$PACMAN" $PACMAN_OPTS "$@")
else
- printf -v cmd "%q " "$PACMAN" "$@"
+ cmd=("$PACMAN" "$@")
fi
if (( ! ASROOT )) && [[ ! $1 = -@(T|Qq) ]]; then
if type -p sudo >/dev/null; then
- cmd="sudo $cmd"
+ cmd=(sudo "${cmd[@]}")
else
- cmd="su root -c '$cmd'"
+ cmd=(su root -c "$(printf '%q ' "${cmd[@]}")")
fi
fi
- eval "$cmd"
+ "${cmd[@]}"
}
check_deps() {