modalias.prov: use "command" rather than "which" to check existence of commands
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
parent
0c336570df
commit
6a6920aed2
@ -26,10 +26,12 @@ if ! [ -z "$is_kernel_package" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for presence of the commands used
|
# Check for presence of the commands used.
|
||||||
which /sbin/modinfo >/dev/null || exit 0
|
# "command" is a builtin, faster to use than fork+execing "which" - see
|
||||||
which sed >/dev/null || exit 0
|
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
|
||||||
which sort >/dev/null || exit 0
|
command -v /sbin/modinfo >/dev/null || exit 1
|
||||||
|
command -v sed >/dev/null || exit 1
|
||||||
|
command -v sort >/dev/null || exit 1
|
||||||
|
|
||||||
print_modaliases() {
|
print_modaliases() {
|
||||||
declare class=$1 variants=$2 pos=$3
|
declare class=$1 variants=$2 pos=$3
|
||||||
|
Loading…
Reference in New Issue
Block a user