From: Michal Nowak Date: Tue, 2 Jun 2026 09:37:07 +0000 (+0000) Subject: Quote paths in the meson helper scripts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d4c84f92cd6d64bcf132f2cfd898b1bc64b0edf;p=thirdparty%2Fbind9.git Quote paths in the meson helper scripts Quote variable expansions, guard MESON_BUILD_ROOT, and enable nullglob so paths with spaces and empty globs are handled. Assisted-by: Claude:claude-opus-4-8 --- diff --git a/util/meson-dist-package.sh b/util/meson-dist-package.sh index 5ecabaa1b7..9eaf78ddf1 100644 --- a/util/meson-dist-package.sh +++ b/util/meson-dist-package.sh @@ -13,7 +13,7 @@ set -e -if [ -z "$MESON_DIST_ROOT" ] || [ -z "$MESON_SOURCE_ROOT" ]; then +if [ -z "$MESON_DIST_ROOT" ] || [ -z "$MESON_SOURCE_ROOT" ] || [ -z "$MESON_BUILD_ROOT" ]; then echo "meson-dist-package.sh must be run inside meson dist!" exit 1 fi @@ -41,19 +41,19 @@ generate_man_pages() { "${MESON_SOURCE_ROOT}/doc/man" \ "${MESON_BUILD_ROOT}/dist-man" - for man in ${MESON_BUILD_ROOT}/dist-man/man1/*; do + for man in "${MESON_BUILD_ROOT}"/dist-man/man1/*; do [ -f "${man}" ] || continue - cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" + cp "$man" "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" done - for man in ${MESON_BUILD_ROOT}/dist-man/man5/*; do + for man in "${MESON_BUILD_ROOT}"/dist-man/man5/*; do [ -f "${man}" ] || continue - cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" + cp "$man" "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" done - for man in ${MESON_BUILD_ROOT}/dist-man/man8/*; do + for man in "${MESON_BUILD_ROOT}"/dist-man/man8/*; do [ -f "${man}" ] || continue - cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" + cp "$man" "${MESON_DIST_ROOT}/doc/man/${man##*/}.in" done } diff --git a/util/meson-glob.sh b/util/meson-glob.sh index bd5f6d4968..3dcf35bf29 100755 --- a/util/meson-glob.sh +++ b/util/meson-glob.sh @@ -28,8 +28,9 @@ done echo "files(" -pushd ${dir:-.} >/dev/null -for file in ./*.${extension:-c}; do +shopt -s nullglob +pushd "${dir:-.}" >/dev/null +for file in ./*."${extension:-c}"; do echo " '${file:2}'," done popd >/dev/null diff --git a/util/meson-system-test-init.sh b/util/meson-system-test-init.sh index 07ff6f5b28..5841854b54 100644 --- a/util/meson-system-test-init.sh +++ b/util/meson-system-test-init.sh @@ -16,5 +16,5 @@ if [ -z "$BIND_SOURCE_ROOT" ] || [ -z "$BIND_BUILD_ROOT" ]; then exit 1 fi -cp $BIND_BUILD_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR $BIND_SOURCE_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR -cp $BIND_BUILD_ROOT/bin/tests/system/ifconfig.sh $BIND_SOURCE_ROOT/bin/tests/system/ifconfig.sh +cp "$BIND_BUILD_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR" "$BIND_SOURCE_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR" +cp "$BIND_BUILD_ROOT/bin/tests/system/ifconfig.sh" "$BIND_SOURCE_ROOT/bin/tests/system/ifconfig.sh"