From 701171d99a037063b79816bf2faf1b3d2d69b204 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 11 May 2023 14:15:32 +0200 Subject: [PATCH 1/4] build: don't mark nm-cloud-setup as EXPERIMENTAL in build script --- configure.ac | 2 +- meson_options.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e622123435..970bc0f198 100644 --- a/configure.ac +++ b/configure.ac @@ -1085,7 +1085,7 @@ fi AM_CONDITIONAL(BUILD_NMCLI, test "$build_nmcli" = yes) AC_ARG_WITH(nm-cloud-setup, - AS_HELP_STRING([--with-nm-cloud-setup=yes|no], [Build nm-cloud-setup, a tool for automatically configure networking in cloud (EXPERIMENTAL!)])) + AS_HELP_STRING([--with-nm-cloud-setup=yes|no], [Build nm-cloud-setup, a tool for automatically configuring networking in cloud])) if test "$with_nm_cloud_setup" != no; then PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.24.0], [have_libcurl=yes], [have_libcurl=no]) if test "$have_libcurl" != "yes"; then diff --git a/meson_options.txt b/meson_options.txt index 4e359f9e92..015f31f0a3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -39,7 +39,7 @@ option('teamdctl', type: 'boolean', value: false, description: 'enable Teamd con option('ovs', type: 'boolean', value: true, description: 'enable Open vSwitch support') option('nmcli', type: 'boolean', value: true, description: 'Build nmcli') option('nmtui', type: 'boolean', value: true, description: 'Build nmtui') -option('nm_cloud_setup', type: 'boolean', value: false, description: 'Build nm-cloud-setup, a tool for automatically configure networking in cloud (EXPERIMENTAL!)') +option('nm_cloud_setup', type: 'boolean', value: false, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud') option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support') option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support') From e7aa33ebfda02a673fdbd606c64f8c98efd25538 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 11 May 2023 14:17:25 +0200 Subject: [PATCH 2/4] build/autotools: avoid checking twice for libcurl We check once conditionally for enable_concheck, and once for with_nm_cloud_setup. Don't do it twice. --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 970bc0f198..b4ab797571 100644 --- a/configure.ac +++ b/configure.ac @@ -1049,6 +1049,7 @@ else fi AM_CONDITIONAL(WITH_LIBPSL, test "$with_libpsl" != "no") +have_libcurl='' AC_ARG_ENABLE(concheck, AS_HELP_STRING([--enable-concheck], [enable connectivity checking support]), @@ -1087,7 +1088,9 @@ AM_CONDITIONAL(BUILD_NMCLI, test "$build_nmcli" = yes) AC_ARG_WITH(nm-cloud-setup, AS_HELP_STRING([--with-nm-cloud-setup=yes|no], [Build nm-cloud-setup, a tool for automatically configuring networking in cloud])) if test "$with_nm_cloud_setup" != no; then - PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.24.0], [have_libcurl=yes], [have_libcurl=no]) + if test "$have_libcurl" = ""; then + PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.24.0], [have_libcurl=yes], [have_libcurl=no]) + fi if test "$have_libcurl" != "yes"; then AC_MSG_ERROR(--with-nm-cloud-setup requires libcurl library.) fi From 611db44974be5a2fb223026b26de719827a3e4be Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 11 May 2023 14:20:23 +0200 Subject: [PATCH 3/4] build/meson: enable -Dnm_cloud_setup=true by default That is also what autotools does. Keep the behvior in sync. Also, "contrib/scripts/nm-ci-run.sh" does not explicitly enable nm-cloud-setup, so we ended up not building it in test. This solves that, by enabling it by default. --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 015f31f0a3..d49faf3463 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -39,7 +39,7 @@ option('teamdctl', type: 'boolean', value: false, description: 'enable Teamd con option('ovs', type: 'boolean', value: true, description: 'enable Open vSwitch support') option('nmcli', type: 'boolean', value: true, description: 'Build nmcli') option('nmtui', type: 'boolean', value: true, description: 'Build nmtui') -option('nm_cloud_setup', type: 'boolean', value: false, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud') +option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud') option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support') option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support') From e37a15acadd1e3c2a14544cfc02f73b1f033cb62 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 15 May 2023 14:46:41 +0200 Subject: [PATCH 4/4] 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 b4ab797571..783cd68c53 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 590929660a..358cfb1615 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 6ba202674e..3f07a9b198 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 676780b2c8..f9d7cf00a8 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 0e3610c5af..e2b4bdc6d8 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 2746848c1e..b0fd3131f0 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='.'