From a3b335589c9a74aa56f80cf8ebdb38e9176207b3 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Mon, 24 Jan 2022 15:33:01 +0100 Subject: [PATCH] Replace which by POSIX command -v (#829) --- testo | 4 ++-- testo.d/kml.test | 2 +- tools/Dockerfile_f32 | 2 +- tools/Dockerfile_f33 | 2 +- tools/Dockerfile_f34 | 2 +- tools/Dockerfile_f35 | 2 +- tools/nuke_format | 2 +- vtesto | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testo b/testo index 7ce64da08..b5e38ab35 100755 --- a/testo +++ b/testo @@ -111,7 +111,7 @@ utf8bomcheck() xmlwfcheck() { if [ -z "${VALGRIND}" ]; then - if which ${XMLWF} >/dev/null 2>&1; then + if command -v ${XMLWF} >/dev/null 2>&1; then # xmlwf is a bit lame, exit status is always 0 rm -f ${TMPDIR}/xmlwf.out ${XMLWF} $1 2>&1 | tee ${TMPDIR}/xmlwf.out @@ -173,7 +173,7 @@ if [ -z "${VALGRIND}" ]; then fi if [ -z "${VALGRIND}" ]; then - if which ${XMLWF} >/dev/null 2>&1; then + if command -v ${XMLWF} >/dev/null 2>&1; then echo "Running well-formed XML test" for i in ${XMLS} do diff --git a/testo.d/kml.test b/testo.d/kml.test index 2863b86bd..0faafe7b5 100644 --- a/testo.d/kml.test +++ b/testo.d/kml.test @@ -71,7 +71,7 @@ compare ${REFERENCE}/realtime.kml ${TMPDIR}/realtime.kml if [ "${RUNNINGVALGRIND}" != "0" ]; then set -e - if which xmllint > /dev/null; + if command -v xmllint > /dev/null; then KMLS=$(find ${REFERENCE} -name \*.kml) for f in $KMLS diff --git a/tools/Dockerfile_f32 b/tools/Dockerfile_f32 index b77f242f8..9a775a7d0 100644 --- a/tools/Dockerfile_f32 +++ b/tools/Dockerfile_f32 @@ -7,7 +7,7 @@ LABEL maintainer="https://github.com/tsteven4" WORKDIR /app # basic tools to build -RUN dnf install --assumeyes git make valgrind diffutils which findutils langpacks-en && \ +RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en && \ dnf clean all # libraries used by gpsbabel. zlib and shapelib may or may not be used depending qmake options. RUN dnf install --assumeyes libusbx-devel zlib-devel shapelib-devel && \ diff --git a/tools/Dockerfile_f33 b/tools/Dockerfile_f33 index 75cf4f945..d254cf491 100644 --- a/tools/Dockerfile_f33 +++ b/tools/Dockerfile_f33 @@ -7,7 +7,7 @@ LABEL maintainer="https://github.com/tsteven4" WORKDIR /app # basic tools to build -RUN dnf install --assumeyes git make valgrind diffutils which findutils langpacks-en && \ +RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en && \ dnf clean all # libraries used by gpsbabel. zlib and shapelib may or may not be used depending qmake options. RUN dnf install --assumeyes libusbx-devel zlib-devel shapelib-devel && \ diff --git a/tools/Dockerfile_f34 b/tools/Dockerfile_f34 index 54350eec6..353168c8c 100644 --- a/tools/Dockerfile_f34 +++ b/tools/Dockerfile_f34 @@ -7,7 +7,7 @@ LABEL maintainer="https://github.com/tsteven4" WORKDIR /app # basic tools to build -RUN dnf install --assumeyes git make valgrind diffutils which findutils langpacks-en && \ +RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en && \ dnf clean all # libraries used by gpsbabel. zlib and shapelib may or may not be used depending qmake options. RUN dnf install --assumeyes libusbx-devel zlib-devel shapelib-devel && \ diff --git a/tools/Dockerfile_f35 b/tools/Dockerfile_f35 index 2ba2d7883..6561ca0fb 100644 --- a/tools/Dockerfile_f35 +++ b/tools/Dockerfile_f35 @@ -7,7 +7,7 @@ LABEL maintainer="https://github.com/tsteven4" WORKDIR /app # basic tools to build -RUN dnf install --assumeyes git make valgrind diffutils which findutils langpacks-en && \ +RUN dnf install --assumeyes git make valgrind diffutils findutils langpacks-en && \ dnf clean all # libraries used by gpsbabel. zlib and shapelib may or may not be used depending qmake options. RUN dnf install --assumeyes libusb1-devel zlib-devel shapelib-devel && \ diff --git a/tools/nuke_format b/tools/nuke_format index 11097a6e2..e0d4c952a 100755 --- a/tools/nuke_format +++ b/tools/nuke_format @@ -1,6 +1,6 @@ # usage nuke_format format_name -SED=$(which gsed) +SED=$(command -v gsed) EDITOR="${EDITOR:-vim}" # $1 = format $2 = file in all functions diff --git a/vtesto b/vtesto index 0debc413d..46a6b6671 100755 --- a/vtesto +++ b/vtesto @@ -11,7 +11,7 @@ vg_version_warning() { echo "If you get \"unhandled instruction bytes: 0xF 0xC7\" warnings from" 1>&2 echo "valgrind your valgrind is too old." 1>&2 echo "valgrind 3.13.0 and later should not have this problem." 1>&2 - echo "$(which valgrind) is $(valgrind --version)" 1>&2 + echo "$(command -v valgrind) is $(valgrind --version)" 1>&2 echo "" 1>&2 }