aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/rpm
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-01-14 14:20:20 +0100
committerPeter Wu <peter@lekensteyn.nl>2019-01-14 19:01:27 +0000
commit60e32b6eb35f4ac5a7ced5b76a19d3d80e6e8e2d (patch)
treeef2f15911add432b615cdef0b2ea31a69ce85824 /packaging/rpm
parente5f7f15b1f43f02e07e550596a6ccd47c5291a6f (diff)
RPM: remove dependency on the which utility
It is not necessary to know the full path to a program. Instead use the 'type' shell builtin (part of POSIX) to detect availability. Change-Id: Id68b298625d389a1f7843f52f56312bf81d97b80 Reviewed-on: https://code.wireshark.org/review/31540 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'packaging/rpm')
-rw-r--r--packaging/rpm/wireshark.spec.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/packaging/rpm/wireshark.spec.in b/packaging/rpm/wireshark.spec.in
index a9c391fb4d..8704c31c21 100644
--- a/packaging/rpm/wireshark.spec.in
+++ b/packaging/rpm/wireshark.spec.in
@@ -293,7 +293,7 @@ cmake3 \
%if %{with ninja}
# Older RPM-based distributions used ninja-build in order to prevent a collision with
# the Ninja IRC client: https://bugzilla.redhat.com/show_bug.cgi?id=1166135
-NINJA=$(which ninja || which ninja-build)
+NINJA=$(type ninja >/dev/null 2>&1 && echo ninja || echo ninja-build)
$NINJA
%else
# Suggestion: put this in your ~/.rpmmacros (without the hash sign, of course):
@@ -307,7 +307,7 @@ rm -rf $RPM_BUILD_ROOT
cd build
%endif
%if %{with ninja}
-NINJA=$(which ninja || which ninja-build)
+NINJA=$(type ninja >/dev/null 2>&1 && echo ninja || echo ninja-build)
DESTDIR=$RPM_BUILD_ROOT $NINJA install
%if %{with guides}
DESTDIR=$RPM_BUILD_ROOT $NINJA install_guides