summaryrefslogtreecommitdiff
path: root/sys-apps/pciutils/files/pciutils-3.8.0-no-which.patch
blob: 3024d73555d3d474d028f15201419debbb758bb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
https://github.com/pciutils/pciutils/pull/105

From 91bf24dd3c91f826377548b7e164b49cfed56f9a Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sun, 19 Jun 2022 23:52:22 +0100
Subject: [PATCH 1/2] lib/configure: drop usage of which

'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>
--- a/lib/configure
+++ b/lib/configure
@@ -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