This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=91f3cba7a8feefc9178fb14449c7cf8c6588b83c commit 91f3cba7a8feefc9178fb14449c7cf8c6588b83c Author: Guillem Jover <guil...@debian.org> AuthorDate: Thu May 22 10:40:38 2025 +0200 Quote variables in shell scripts Changelog: internal Warned-by: shellcheck --- debian/dpkg.postinst | 4 ++-- debian/dselect.postrm | 6 +++--- debian/tests/test-not-root | 2 +- debian/tests/test-root | 2 +- tests/t-conffile-divert-conffile/pkg-conff-divert/DEBIAN/preinst | 2 +- tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postinst | 6 +++--- tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postrm | 6 +++--- tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/preinst | 6 +++--- tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/prerm | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/debian/dpkg.postinst b/debian/dpkg.postinst index b192d5021..200a7ebdb 100644 --- a/debian/dpkg.postinst +++ b/debian/dpkg.postinst @@ -9,9 +9,9 @@ PROGNAME=dpkg create_db_native_arch() { - local admindir=${DPKG_ADMINDIR:-/var/lib/dpkg} + local admindir="${DPKG_ADMINDIR:-/var/lib/dpkg}" - echo "$DPKG_MAINTSCRIPT_ARCH" >$admindir/arch-native + echo "$DPKG_MAINTSCRIPT_ARCH" >"$admindir/arch-native" } setup_aliases() diff --git a/debian/dselect.postrm b/debian/dselect.postrm index c85dc2ace..9d1c7d57e 100644 --- a/debian/dselect.postrm +++ b/debian/dselect.postrm @@ -5,11 +5,11 @@ set -e # Remove dselect methods state. purge_state() { - local admindir=${DPKG_ADMINDIR:-/var/lib/dpkg} + local admindir="${DPKG_ADMINDIR:-/var/lib/dpkg}" - rm -f $admindir/cmethopt 2>/dev/null + rm -f "$admindir/cmethopt" 2>/dev/null for method in file ftp mnt media; do - rm -rf $admindir/methods/$method/* 2>/dev/null + rm -rf "$admindir"/methods/$method/* 2>/dev/null done } diff --git a/debian/tests/test-not-root b/debian/tests/test-not-root index fbb23d687..e818098c7 100644 --- a/debian/tests/test-not-root +++ b/debian/tests/test-not-root @@ -9,7 +9,7 @@ fi srcdir="$(pwd)" -cd $AUTOPKGTEST_TMP +cd "$AUTOPKGTEST_TMP" "$srcdir/configure" \ --disable-nls \ --disable-dselect \ diff --git a/debian/tests/test-root b/debian/tests/test-root index 033961933..745a5d3be 100644 --- a/debian/tests/test-root +++ b/debian/tests/test-root @@ -9,7 +9,7 @@ fi srcdir="$(pwd)" -cd $AUTOPKGTEST_TMP +cd "$AUTOPKGTEST_TMP" "$srcdir/configure" \ --disable-nls \ --disable-dselect \ diff --git a/tests/t-conffile-divert-conffile/pkg-conff-divert/DEBIAN/preinst b/tests/t-conffile-divert-conffile/pkg-conff-divert/DEBIAN/preinst index 4ac5cfa97..3bbad4653 100755 --- a/tests/t-conffile-divert-conffile/pkg-conff-divert/DEBIAN/preinst +++ b/tests/t-conffile-divert-conffile/pkg-conff-divert/DEBIAN/preinst @@ -4,7 +4,7 @@ set -e if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then # XXX: We should use the copy method instead once available. - cp -a $DPKG_ROOT/test-conffile $DPKG_ROOT/test-conffile.diverted + cp -a "$DPKG_ROOT/test-conffile" "$DPKG_ROOT/test-conffile.diverted" dpkg-divert --package pkg-conff-divert --no-rename \ --divert /test-conffile.diverted --add /test-conffile fi diff --git a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postinst b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postinst index 580884db1..da151be2f 100755 --- a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postinst +++ b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postinst @@ -9,8 +9,8 @@ for d in /dev/fd/ /proc/self/fd/; do fi done -if [ -n $fddir ]; then - ls -l $fddir +if [ -n "$fddir" ]; then + ls -l "$fddir" # We should have the 3 standard descriptors, plus 1 for the open directory. - [ `ls $fddir | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd + [ `ls "$fddir" | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd fi diff --git a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postrm b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postrm index 580884db1..da151be2f 100755 --- a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postrm +++ b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/postrm @@ -9,8 +9,8 @@ for d in /dev/fd/ /proc/self/fd/; do fi done -if [ -n $fddir ]; then - ls -l $fddir +if [ -n "$fddir" ]; then + ls -l "$fddir" # We should have the 3 standard descriptors, plus 1 for the open directory. - [ `ls $fddir | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd + [ `ls "$fddir" | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd fi diff --git a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/preinst b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/preinst index 580884db1..da151be2f 100755 --- a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/preinst +++ b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/preinst @@ -9,8 +9,8 @@ for d in /dev/fd/ /proc/self/fd/; do fi done -if [ -n $fddir ]; then - ls -l $fddir +if [ -n "$fddir" ]; then + ls -l "$fddir" # We should have the 3 standard descriptors, plus 1 for the open directory. - [ `ls $fddir | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd + [ `ls "$fddir" | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd fi diff --git a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/prerm b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/prerm index 580884db1..da151be2f 100755 --- a/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/prerm +++ b/tests/t-maintscript-leak/pkg-maintscript-leak/DEBIAN/prerm @@ -9,8 +9,8 @@ for d in /dev/fd/ /proc/self/fd/; do fi done -if [ -n $fddir ]; then - ls -l $fddir +if [ -n "$fddir" ]; then + ls -l "$fddir" # We should have the 3 standard descriptors, plus 1 for the open directory. - [ `ls $fddir | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd + [ `ls "$fddir" | wc -l` -eq 4 ] || echo WARN: maintscript leaks fd fi -- Dpkg.Org's dpkg