]> mj.ucw.cz Git - pciutils.git/commitdiff
lib/configure: drop usage of which
authorSam James <sam@gentoo.org>
Sun, 19 Jun 2022 22:52:22 +0000 (23:52 +0100)
committerSam James <sam@gentoo.org>
Sun, 19 Jun 2022 22:52:46 +0000 (23:52 +0100)
'which' is not required by POSIX and is an external command which may not be
available, and 'command -v' does the job just fine.

Debian and Gentoo at least are both making efforts to drop which from
their base system package list.

Signed-off-by: Sam James <sam@gentoo.org>
lib/configure

index 45a416a7620e0763216d323ade801bdf90f6073e..1c3343a7997019b68eb226fe41f520b94afb51c6 100755 (executable)
@@ -238,7 +238,7 @@ if [ "$sys" = linux ] ; then
                PKG_CONFIG=pkg-config
        fi
        if [ "$LIBKMOD" != no ] ; then
-               if ! which $PKG_CONFIG >/dev/null ; then
+               if ! command -v $PKG_CONFIG >/dev/null ; then
                        echo_n "($PKG_CONFIG not found) "
                elif $PKG_CONFIG libkmod ; then
                        LIBKMOD_DETECTED=1
@@ -268,7 +268,7 @@ if [ "$sys" = linux ] ; then
        if [ "$HWDB" = yes -o "$HWDB" = no ] ; then
                echo "$HWDB (set manually)"
        else
-               if `which pkg-config >/dev/null && pkg-config --atleast-version=196 libudev` ; then
+               if `command -v pkg-config >/dev/null && pkg-config --atleast-version=196 libudev` ; then
                        HWDB=yes
                else
                        HWDB=no