dose3: Overly sensitive to malformed Packages files (APT)
At least in version 7.0.0, the debcheck function (maybe other functionality as well) is overly sensitive to malformed package information in Packages files piped into the command.
APT itself has no issues with multi-line Suggests/Depends/Provides/Recommends fields. Debian allows these to be multiline in the source packages debian/control file, though dpkg-gencontrol silently folds these for fields into a single line each and thus Debian has no packages with multi-line entries here, the following package information causes dose-debcheck to fail:
Package: bazel-5.0.0
Version: 5.0.0
Maintainer: The Bazel Authors <bazel-dev@googlegroups.com>
Architecture: amd64
Depends: g++, zlib1g-dev, unzip
Suggests: google-jdk | java8-sdk-headless | java8-jdk | java8-sdk |
oracle-java8-installer, bash-completion
Description: Bazel is a tool that automates software builds and tests.
Supported build tasks include running compilers and linkers to produce
executable programs and libraries, and assembling deployable packages
for Android, iOS and other target environments. Bazel is similar to
other tools like Make, Ant, Gradle, Buck, Pants and Maven.
Description-md5: 72cec041981bfe49fb7d7b6d540d9076
Homepage: https://bazel.build
Built-Using: bazel
Filename: pool/bazel-5.0.0_5.0.0_amd64_255b6d799aaa0d9939150b1fef843bf2df8407baa71b9672de7d88cdeb6f50dd.deb
Priority: optional
SHA256: 255b6d799aaa0d9939150b1fef843bf2df8407baa71b9672de7d88cdeb6f50dd
Section: contrib/devel
Size: 48040812
(From https://storage.googleapis.com/bazel-apt/dists/stable/jdk1.8/binary-amd64/Packages)
Older dose3 version 6.0.1 seemed unaffected by this.
The resulting error is:
Fatal error in module dose_deb.packages:
Filename -
Parser Error in Package (bazel-5.2.0,5.2.0,amd64)
Suggests : Field Suggests has a wrong value (character 57-58:
character 57-58: Unexpected token : '
'.. (vpkgformula)): 'google-jdk | java8-sdk-headless | java8-jdk | java8-sdk |
oracle-java8-installer, bash-completion'
To be honest, I'm not sure if the failure might be intentional. However, if so, the error message seems bad (something like "Package bazel-5.2.0 contains illegal multi-line Suggests: ..." would be more helpful. However, I'd much prefer a less strict adherence to the Debian policy here (which admittedly only list "Description" as a multiline field for binary packages). Perhaps with an option to make it strict on the format.
A note on 5a72f5b1
- Multi-line Build-Depends in debian source packages are very common.
5e346519
is probably the cause for the failure we are seeing, but it does one
thing the Debian tooling doesn't do: When joining multiple lines, it
inserts \n
- Debian tooling essentially joins the lines with just a
space.
Please consider changing
https://gitlab.com/irill/dose3/-/blob/5e346519bd50f4f972aa522ad8cb4632580dd573/src/common/format822_parser.mly#L28
to use " "
instead of "\n "
(and adjusting the test).
Kind regards, Sven