index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Allan McRae <allan@archlinux.org> | 2010-06-30 20:42:30 +1000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-07-01 00:23:20 -0500 |
commit | 622326bb37a9f7eb1db27ac0166e791d7a949e0c (patch) | |
tree | 5090c56497570fb5def7201f7ca5d8068788d3f6 /scripts/makepkg.sh.in | |
parent | 68dff73463dd06d2055bcbd48be9bc74e786be5c (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 13 |
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index f3c72172..516e1d7c 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -368,17 +368,16 @@ download_file() { } run_pacman() { - local ret=0 + local cmd + printf -v cmd "%q " "$PACMAN" $PACMAN_OPTS "$@" if (( ! ASROOT )) && [[ $1 != "-T" && $1 != "-Qq" ]]; then - if [ "$(type -p sudo)" ] && sudo -l $PACMAN &>/dev/null; then - sudo $PACMAN $PACMAN_OPTS "$@" || ret=$? + if [ "$(type -p sudo)" ]; then + cmd="sudo $cmd" else - su -c "$PACMAN $PACMAN_OPTS $*" || ret=$? + cmd="su -c '$cmd'" fi - else - $PACMAN $PACMAN_OPTS "$@" || ret=$? fi - return $ret + eval "$cmd" } check_deps() { |