(This mail is only related to the quoted sidenote question)

On Thu, May 16, 2024 at 02:11:41PM +0200, Andreas Beckmann wrote:
> not sure if it is allowed to inject spaces between '!' and arch as in
> ..."  ppc64  !  mips64el ! s390x "...

No, debian-policy §7.1 says "Exclamation marks may be prepended to each
of the names." and said right before that "[…] names […] separated by
whitespace".

dpkg agrees on this:
| LANG=C dpkg-checkbuilddeps -d 'foobar [! amd64]' /dev/null
| dpkg-checkbuilddeps: error: '!' is not a legal architecture in list '! amd64'


It does have interesting behaviour on another whitespace-related case
which is forbidden by policy via "The brackets enclose a non-empty list":
| LANG=C dpkg-checkbuilddeps -d 'foobar []' /dev/null
| dpkg-checkbuilddeps: warning: can't parse dependency foobar []
| dpkg-checkbuilddeps: error: cannot parse 
Build-Depends/Build-Depends-Arch/Build-Depends-Indep field

vs

| LANG=C dpkg-checkbuilddeps -d 'foobar [ ]' /dev/null && echo 'OK'
| OK

(but undefined behaviour on bad input isn't too bad)


As a sidenote, as you haven't started with a '!' that string is a policy
violation due to "(It is not permitted for some names to be prepended
with exclamation marks while others aren’t.)". dpkg and APT both parse
such strings and do what might be meant by it through.


Best regards

David Kalnischkies

Attachment: signature.asc
Description: PGP signature

Reply via email to