]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Quote paths in the meson helper scripts
authorMichal Nowak <mnowak@isc.org>
Tue, 2 Jun 2026 09:37:07 +0000 (09:37 +0000)
committerMichal Nowak <mnowak@isc.org>
Tue, 30 Jun 2026 15:03:25 +0000 (17:03 +0200)
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
util/meson-dist-package.sh
util/meson-glob.sh
util/meson-system-test-init.sh

index 5ecabaa1b731fe1af80e3c355de9d73548e790a4..9eaf78ddf12e712381528f4638f82a1a6903002b 100644 (file)
@@ -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
 }
 
index bd5f6d49688a384c613f6b99b9f6efabdeaae99f..3dcf35bf29b6232624f2a8bc0435173a8e63b091 100755 (executable)
@@ -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
index 07ff6f5b28245eb474b29f7782a1f7951333150f..5841854b5472e8b5c4f287f5a8a648aa315f8613 100644 (file)
@@ -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"