diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-05-05 14:54:29 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-05-05 14:54:29 +0200 |
commit | 2de05069d2d8195d75790bb392e5825c34ed3f36 (patch) | |
tree | aaefd79a8993818b55fb17e90325b0f425938eca | |
parent | 30b4e9ecfdc5939af9051bd4fc1d7f30871b8118 (diff) | |
download | mbuto-2de05069d2d8195d75790bb392e5825c34ed3f36.tar mbuto-2de05069d2d8195d75790bb392e5825c34ed3f36.tar.gz mbuto-2de05069d2d8195d75790bb392e5825c34ed3f36.tar.bz2 mbuto-2de05069d2d8195d75790bb392e5825c34ed3f36.tar.lz mbuto-2de05069d2d8195d75790bb392e5825c34ed3f36.tar.xz mbuto-2de05069d2d8195d75790bb392e5825c34ed3f36.tar.zst mbuto-2de05069d2d8195d75790bb392e5825c34ed3f36.zip |
mbuto: In prog_add(), look for executable path in output from which
...instead of just picking the output: on Fedora and RHEL 'which'
itself is an alias, but its actual path will also be reported by
'which -a'.
Reported-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-x | mbuto | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -780,7 +780,15 @@ prog_add() { IFS=',' for __a in ${1}; do - __bin="$(${WHICH} "${__a}")" && break + # We might have alias definitions too, look for a path + IFS=' +' + __bin= + for __path in $(${WHICH} -a "${__a}" 2>/dev/null); do + [ -x "${__path}" ] && __bin="${__path}" && break + done + [ -n "${__bin}" ] && break + IFS=',' done unset IFS [ -z "${__bin}" ] && err "Can't source ${1}" |