diff options
author | Sevinj Aghayeva <sevinj.aghayeva@gmail.com> | 2022-04-17 13:27:19 -0400 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-04-21 16:40:29 +0200 |
commit | 2458f4064b63e251892bdad5a9c5d2e539def0c0 (patch) | |
tree | 72bb644ab303017cc286aa96d9b8b14adee46cdf | |
parent | ab0a2ac9c36854d3e9ebdbace5ccddc45029f839 (diff) | |
download | mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.gz mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.bz2 mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.lz mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.xz mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.zst mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.zip |
mbuto: undo commit 6199e368
Commit 6199e368 moves argument parsing before checking fakeroot and saves the
arguments in ARGS variable. Unfortunately, passing ARGS to the recursive call
flattens and removes quotes, which disables passing multiple arguments to
suboptions, as in -C "net proc". For now we undo this commit to enable multiple
argument passing to suboptions.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
-rwxr-xr-x | mbuto | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -1159,7 +1159,14 @@ usage() { ################################################################################ -ARGS=${@} +# 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" + fi + PATH="${PATH}:/sbin:/usr/sbin" "${FAKEROOT}" "${0}" "${@}" + exit ${?} +fi # Parse options while getopts :c:df:k:m:p:s:vh __opt; do @@ -1182,15 +1189,6 @@ done shift $((OPTIND - 1)) [ -z "${PROFILE}" ] && PROFILE="base" -# 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" - fi - PATH="${PATH}:/sbin:/usr/sbin" "${FAKEROOT}" "${0}" ${ARGS} - exit ${?} -fi - # Check needed tools, exit if any is missing for __l in ${TOOLS}; do cmd_check "${__l}" |