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>
This commit is contained in:
parent
6a413fe72f
commit
bdd8ebd631
1 changed files with 7 additions and 7 deletions
|
@ -1449,6 +1449,13 @@ check_software() {
|
||||||
# check for needed software
|
# check for needed software
|
||||||
local ret=0
|
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
|
# fakeroot - building as non-root user
|
||||||
if [[ $(check_buildenv fakeroot) = "y" ]] && (( EUID > 0 )); then
|
if [[ $(check_buildenv fakeroot) = "y" ]] && (( EUID > 0 )); then
|
||||||
if ! type -p fakeroot >/dev/null; then
|
if ! type -p fakeroot >/dev/null; then
|
||||||
|
@ -1898,13 +1905,6 @@ else
|
||||||
fi
|
fi
|
||||||
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 pkgname pkgbase pkgver pkgrel epoch pkgdesc url license groups provides
|
||||||
unset md5sums replaces depends conflicts backup source install changelog build
|
unset md5sums replaces depends conflicts backup source install changelog build
|
||||||
unset makedepends optdepends options noextract
|
unset makedepends optdepends options noextract
|
||||||
|
|
Loading…
Add table
Reference in a new issue