From 9366f1fee77fe853f3059660cba9df63a11e37ad Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof <git@jochen.sprickerhof.de> Date: Wed, 22 Jan 2025 10:35:13 +0100 Subject: [PATCH] Use format string for shell printf Fixes: sh: 1: printf: usage: printf format [arg ...] due to Dir::Etc::trusted no longer being a thing since apt 2.9.24. --- mmdebstrap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index 87c91e8..a263b27 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -5548,9 +5548,9 @@ sub main() { # obtain the correct defaults for the keyring locations that apt knows # about my $apttrusted - = `eval \$(apt-config shell v Dir::Etc::trusted/f); printf \$v`; + = `eval \$(apt-config shell v Dir::Etc::trusted/f); printf %s \$v`; my $apttrustedparts - = `eval \$(apt-config shell v Dir::Etc::trustedparts/d); printf \$v`; + = `eval \$(apt-config shell v Dir::Etc::trustedparts/d); printf %s \$v`; chomp(my $hostarch = `dpkg --print-architecture`); my $options = { @@ -5871,7 +5871,7 @@ sub main() { } # setting PATH for chroot, ldconfig, start-stop-daemon... - my $defaultpath = `eval \$(apt-config shell v DPkg::Path); printf \$v`; + my $defaultpath = `eval \$(apt-config shell v DPkg::Path); printf %s \$v`; if (length $ENV{PATH}) { ## no critic (Variables::RequireLocalizedPunctuationVars) $ENV{PATH} = "$ENV{PATH}:$defaultpath"; @@ -8462,8 +8462,8 @@ its core, what B<mmdebstrap> does can be put into a 14 line shell script: Apt::Architecture "$(dpkg --print-architecture)"; Apt::Architectures "$(dpkg --print-architecture)"; Dir "$(cd "$2" && pwd)"; - Dir::Etc::Trusted "$(eval "$(apt-config shell v Dir::Etc::Trusted/f)"; printf "$v")"; - Dir::Etc::TrustedParts "$(eval "$(apt-config shell v Dir::Etc::TrustedParts/d)"; printf "$v")"; + Dir::Etc::Trusted "$(eval "$(apt-config shell v Dir::Etc::Trusted/f)"; printf %s "$v")"; + Dir::Etc::TrustedParts "$(eval "$(apt-config shell v Dir::Etc::TrustedParts/d)"; printf %s "$v")"; END echo "deb http://deb.debian.org/debian/ $1 main" > "$2/etc/apt/sources.list" APT_CONFIG="$2/apt.conf" apt-get update