summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Bélanger <snowmaniscool@gmail.com>2011-06-25 04:07:23 +0200
committerDan McGee <dan@archlinux.org>2011-06-27 16:24:19 +0200
commitbdd8ebd631bc305d1a15f4a873b550c9438ac0af (patch)
treef4413791e6e30722742ce3e31e018f84bc303e74
parent6a413fe72f610f0ec11aa2aee78b248c51727e93 (diff)
downloadpacman-bdd8ebd631bc305d1a15f4a873b550c9438ac0af.tar.gz
pacman-bdd8ebd631bc305d1a15f4a873b550c9438ac0af.tar.xz
makepkg: Move check for sudo into check_software function
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index ebe010b6..4e15d541 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1449,6 +1449,13 @@ check_software() {
# check for needed software
local ret=0
+ # check for sudo if we will need it during makepkg execution
+ if (( ! ( ASROOT || INFAKEROOT ) && ( DEP_BIN || RMDEPS || INSTALL ) )); then
+ if ! type -p sudo >/dev/null; then
+ warning "$(gettext "Sudo can not be found. Will use su to acquire root privileges.")"
+ fi
+ fi
+
# fakeroot - building as non-root user
if [[ $(check_buildenv fakeroot) = "y" ]] && (( EUID > 0 )); then
if ! type -p fakeroot >/dev/null; then
@@ -1898,13 +1905,6 @@ else
fi
fi
-# check for sudo if we will need it during makepkg execution
-if (( ! ( ASROOT || INFAKEROOT ) && ( DEP_BIN || RMDEPS || INSTALL ) )); then
- if ! type -p sudo >/dev/null; then
- warning "$(gettext "Sudo can not be found. Will use su to acquire root privileges.")"
- fi
-fi
-
unset pkgname pkgbase pkgver pkgrel epoch pkgdesc url license groups provides
unset md5sums replaces depends conflicts backup source install changelog build
unset makedepends optdepends options noextract