diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 68463b8def..ab17f9826a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,10 +40,10 @@ variables: # these tags should be updated each time the list of packages is updated # changing these will force rebuilding the associated image # Note: these tags have no meaning and are not tied to a particular NM version - FEDORA_TAG: '2020-11-17.0-5276eb5b0e3c' + FEDORA_TAG: '2020-11-17.0-0a04bc0f5618' UBUNTU_TAG: '2020-11-17.0-89dd88de8047' DEBIAN_TAG: '2020-11-17.0-89dd88de8047' - CENTOS_TAG: '2020-11-17.0-5276eb5b0e3c' + CENTOS_TAG: '2020-11-17.0-0a04bc0f5618' FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh' UBUNTU_EXEC: 'bash .gitlab-ci/debian-install.sh' diff --git a/.gitlab-ci/build.sh b/.gitlab-ci/build.sh index 84beab73ea..fc118b8998 100755 --- a/.gitlab-ci/build.sh +++ b/.gitlab-ci/build.sh @@ -16,8 +16,8 @@ locale -a env meson --version -! which dpkg || dpkg -l -! which yum || yum list installed +! command -v dpkg &>/dev/null || dpkg -l +! command -v yum &>/dev/null || yum list installed # The formatting depends on the version of python black. # We have a dedicated test that checks our formatting, which diff --git a/.gitlab-ci/fedora-install.sh b/.gitlab-ci/fedora-install.sh index 12f6f73b5f..fe2fd55669 100755 --- a/.gitlab-ci/fedora-install.sh +++ b/.gitlab-ci/fedora-install.sh @@ -28,13 +28,13 @@ fi NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES -yum install -y glibc-langpack-pl ccache clang which +yum install -y glibc-langpack-pl ccache clang # containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html # to generate proper documentation. yum reinstall -y --setopt='tsflags=' glib2-doc -if which dnf &>/dev/null; then +if command -v dnf &>/dev/null; then dnf install -y python3-dnf-plugins-core dnf debuginfo-install -y glib2 else diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES index 54793c86e0..739433dee9 100755 --- a/contrib/fedora/REQUIRED_PACKAGES +++ b/contrib/fedora/REQUIRED_PACKAGES @@ -12,7 +12,7 @@ set -xe -DNF="$( ( which dnf || dnf --version ) &>/dev/null && echo dnf || echo yum)" +DNF="$(command -v dnf &>/dev/null && echo dnf || echo yum)" install() { if [ "$NM_INSTALL" != "" ]; then diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index 0e3b82c7e6..abfa42e210 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -255,10 +255,10 @@ ls -dla \ 2>/dev/null | sed 's/^/ /' LOG if [[ "$BUILDTYPE" == "SRPM" ]]; then - LOG sudo $(which dnf &>/dev/null && echo dnf builddep || echo yum-builddep) $TEMP_LATEST/SRPMS/*.src.rpm + LOG sudo $(command -v dnf &>/dev/null && echo dnf builddep || echo yum-builddep) $TEMP_LATEST/SRPMS/*.src.rpm LOG else - LOG "sudo $(which dnf &>/dev/null && echo dnf || echo yum) install '$TEMP_LATEST/RPMS'/*/*.rpm" + LOG "sudo $(command -v dnf &>/dev/null && echo dnf || echo yum) install '$TEMP_LATEST/RPMS'/*/*.rpm" LOG fi diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index 4d46ddb018..10b731c46d 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -36,7 +36,7 @@ _is_true() { } USE_CCACHE=0 -if which ccache &>/dev/null; then +if command -v ccache &>/dev/null; then USE_CCACHE=1 export PATH="/usr/lib64/ccache:/usr/lib/ccache${PATH:+:${PATH}}" fi diff --git a/contrib/scripts/nm-code-format-container.sh b/contrib/scripts/nm-code-format-container.sh index 680c916f21..0be754f57d 100755 --- a/contrib/scripts/nm-code-format-container.sh +++ b/contrib/scripts/nm-code-format-container.sh @@ -38,7 +38,7 @@ if ! podman container exists "$PODNAME" ; then -v "$DIR:/tmp/NetworkManager:Z" \ -w /tmp/NetworkManager \ fedora:33 \ - /bin/bash -c 'dnf upgrade -y && dnf install -y git which /usr/bin/clang-format && ./contrib/scripts/nm-code-format.sh -i' + /bin/bash -c 'dnf upgrade -y && dnf install -y git /usr/bin/clang-format && ./contrib/scripts/nm-code-format.sh -i' exit 0 fi diff --git a/contrib/scripts/nm-code-format.sh b/contrib/scripts/nm-code-format.sh index c393490b19..3552413bfe 100755 --- a/contrib/scripts/nm-code-format.sh +++ b/contrib/scripts/nm-code-format.sh @@ -37,7 +37,7 @@ EXCLUDE=":(exclude)shared/systemd/src :(exclude)shared/c-stdaux :(exclude)shared/n-acd" -if ! which clang-format &> /dev/null; then +if ! command -v clang-format &> /dev/null; then echo -n "Error: clang-format is not installed, " echo "on RHEL/Fedora/CentOS run 'dnf install clang-tools-extra'" exit 1 diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh index f452d9d4b8..f8a2bdd584 100755 --- a/tools/run-nm-test.sh +++ b/tools/run-nm-test.sh @@ -207,7 +207,7 @@ fi NMTST_DBUS_RUN_SESSION=() if _is_true "$NMTST_LAUNCH_DBUS"; then - if ! which dbus-run-session &>/dev/null ; then + if ! command -v dbus-run-session &>/dev/null ; then eval `dbus-launch --sh-syntax` trap "kill $DBUS_SESSION_BUS_PID" EXIT else @@ -249,7 +249,7 @@ if ! _is_true "$NMTST_USE_VALGRIND" 0; then fi if [[ -z "${NMTST_VALGRIND}" ]]; then - NMTST_VALGRIND=`which valgrind` || die "cannot find valgrind binary. Set \$NMTST_VALGRIND" + NMTST_VALGRIND="$(command -v valgrind)" || die "cannot find valgrind binary. Set \$NMTST_VALGRIND" else test -e "${NMTST_VALGRIND}" || die "cannot find valgrind binary from NMTST_VALGRIND=\"${NMTST_VALGRIND}\"" fi