Hi,

thank you for reporting this!

Quoting Josh Triplett (2025-02-09 11:50:53)
> When run, mmdebstrap produces this error:
> sh: 1: printf: usage: printf format [arg ...]
> 
> This comes from the following line:
>     my $apttrusted
>       = `eval \$(apt-config shell v Dir::Etc::trusted/f); printf \$v`;
> 
> The apt-config invocation produces no output, so `v` doesn't exist, and
> `printf $v` becomes just `printf`, which produces that error.
> 
> All the invocations of apt-config should look like the invocation from
> the documentation instead:
> eval "$(apt-config shell v Dir::Etc::Trusted/f)"; printf "$v"
> 
> This would make the output empty if apt-config produces no output.

then I do not think that the apt-config documentation is correct. printf
interprets escape sequences and format specifiers in the format string. Thus,
to print the contents of a variable, printf should always be used with %s as
the first argument. I believe Jochen fixed this correctly already here:

https://gitlab.mister-muffin.de/josch/mmdebstrap/commit/9366f1fee77fe853f3059660cba9df63a11e37ad

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to