diff options
author | Dan McGee <dan@archlinux.org> | 2010-07-03 01:29:37 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-07-03 01:29:37 +0200 |
commit | 686b8c146398c5ba9feee2c1fa10bf9e598b2ce8 (patch) | |
tree | 0353500bc444ac60cef120ea6d722c94badfe8ca /scripts | |
parent | 1a9db4cac7cf308188298db48dde5d80ce86a7e9 (diff) | |
parent | fcb4f0264f2b8e0a6ed1e7eebfe00f662ba94ef2 (diff) | |
download | pacman-686b8c146398c5ba9feee2c1fa10bf9e598b2ce8.tar.gz pacman-686b8c146398c5ba9feee2c1fa10bf9e598b2ce8.tar.xz |
Merge branch 'maint'
Conflicts:
scripts/makepkg.sh.in
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index efc56912..9f3bbb2c 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -370,17 +370,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 >/dev/null && 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() { |