diff options
-rwxr-xr-x | mbuto | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1179,10 +1179,11 @@ usage() { # If we're not running as root, re-run with fakeroot if [ "${LD_PRELOAD}" != "libfakeroot-sysv.so" ] && [ "$(id -u)" -ne 0 ]; then if ! FAKEROOT="$(command -v fakeroot)"; then - err "Not root and no fakeroot available, exiting" + __fakeroot_missing="y" + else + PATH="${PATH}:/sbin:/usr/sbin" "${FAKEROOT}" "${0}" "${@}" + exit ${?} fi - PATH="${PATH}:/sbin:/usr/sbin" "${FAKEROOT}" "${0}" "${@}" - exit ${?} fi # Parse options @@ -1206,6 +1207,11 @@ done shift $((OPTIND - 1)) [ -z "${PROFILE}" ] && PROFILE="base" +if [ "${__fakeroot_missing}" = "y" ]; then + err "Not root and no fakeroot available, exiting" + exit 1 +fi + # Check needed tools, exit if any is missing for __l in ${TOOLS}; do cmd_check "${__l}" |