From e37a15acadd1e3c2a14544cfc02f73b1f033cb62 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 15 May 2023 14:46:41 +0200 Subject: [PATCH] all: avoid "==" bashism in scripts --- configure.ac | 4 ++-- contrib/fedora/rpm/build.sh | 2 +- contrib/fedora/rpm/build_clean.sh | 2 +- contrib/scripts/nm-ci-run.sh | 2 +- contrib/scripts/nm-setup-git.sh | 4 ++-- tools/check-docs.sh | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index b4ab79757..783cd68c5 100644 --- a/configure.ac +++ b/configure.ac @@ -1073,12 +1073,12 @@ AC_ARG_WITH(nmcli, AS_HELP_STRING([--with-nmcli=yes|no], [Build nmcli]), [], [with_nmcli=yes]) -if test "$with_nmcli" == yes; then +if test "$with_nmcli" = yes; then if test "$with_readline" = none; then AC_MSG_FAILURE([nmcli requires readline library. Use --with-readline or --with-nmcli=no]) fi build_nmcli=yes -elif test "$with_nmcli" == no; then +elif test "$with_nmcli" = no; then build_nmcli=no else AC_MSG_ERROR([invalid --with-nmcli option. Valid options are --with-nmcli=yes|no]) diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index 590929660..358cfb161 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -56,7 +56,7 @@ in_set() { local v="$1" shift for v2; do - test "$v" == "$v2" && return 0 + test "$v" = "$v2" && return 0 done return 1 } diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh index 6ba202674..3f07a9b19 100755 --- a/contrib/fedora/rpm/build_clean.sh +++ b/contrib/fedora/rpm/build_clean.sh @@ -34,7 +34,7 @@ in_set() { local v="$1" shift for v2; do - test "$v" == "$v2" && return 0 + test "$v" = "$v2" && return 0 done return 1 } diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index 676780b2c..f9d7cf00a 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -102,7 +102,7 @@ unset _WITH_VALGRIND_CHECKED _with_valgrind() { _is_true "$WITH_VALGRIND" 0 || return 1 - test "$_WITH_VALGRIND_CHECKED" == "1" && return 0 + test "$_WITH_VALGRIND_CHECKED" = "1" && return 0 _WITH_VALGRIND_CHECKED=1 if [ "$IS_ALPINE" = 1 ]; then diff --git a/contrib/scripts/nm-setup-git.sh b/contrib/scripts/nm-setup-git.sh index 0e3610c5a..e2b4bdc6d 100755 --- a/contrib/scripts/nm-setup-git.sh +++ b/contrib/scripts/nm-setup-git.sh @@ -62,7 +62,7 @@ git_config_reset() { local val="$2" local c=(git config --replace-all "$key" "$val") - test "$#" == 2 || die "invalid arguments to git_config_add(): $@" + test "$#" -eq 2 || die "invalid arguments to git_config_add(): $@" if [ "$(git config --get-all "$key")" = "$val" ]; then SKIP=1 call "${c[@]}" @@ -76,7 +76,7 @@ git_config_add() { local val="$2" local c=(git config --add "$key" "$val") - test "$#" == 2 || die "invalid arguments to git_config_add(): $@" + test "$#" -eq 2 || die "invalid arguments to git_config_add(): $@" if git config --get-all "$key" | grep -qFx "$val"; then SKIP=1 call "${c[@]}" diff --git a/tools/check-docs.sh b/tools/check-docs.sh index 2746848c1..b0fd3131f 100755 --- a/tools/check-docs.sh +++ b/tools/check-docs.sh @@ -39,7 +39,7 @@ libnm_headers() { SOURCEDIR="$1" BUILDDIR="$2" -if test "$SOURCEDIR" == "$BUILDDIR"; then +if test "$SOURCEDIR" = "$BUILDDIR"; then BUILDDIR= fi [ -z "$SOURCEDIR" ] && SOURCEDIR='.'