[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1026920: New upstream version of file/libmagic breaks autopkgtest



On 2022-12-23 17 h 44, Christoph Biedl wrote:
Package: lintian
Version: 2.115.3
Severity: important

Greeting,

my recent upload of file (1:5.43-3) to experiental broke lintian's autopkgtest.

Possibly this is the relevant section.

# Hints do not match
#
# --- ../../autopkgtest_tmp/build-and-evaluate-test-packages/eval/checks/documentation/manual/files-general/hints.specified.calibrated
# +++ ../../autopkgtest_tmp/build-and-evaluate-test-packages/eval/checks/documentation/manual/files-general/hints.actual.parsed
# +files-general (binary): wrong-compression-in-manual-page [usr/share/man/man1/é³¥ã®è©©.1.gz]
#
# Unexpected tags:
#   wrong-compression-in-manual-page
#
#   Failed test 'Lintian passes for files-general'
#   at /usr/share/lintian/lib/Test/Lintian/Run.pm line 343.

[ https://ci.debian.net/data/autopkgtest/unstable/amd64/l/lintian/29591169/log.gz ]

While I didn't check what precisely went wrong, I reckon it's a slightly
changed output on gz-compressed files.

Can you please check and adjust your tests? I'd like to upload to
unstable in a week or so, and I'd prefer to have no autopkgtest breakage
by then.

Sorry for the mess, and I'm sorry this will happen again - upstream
changes file's output every now and then. The only help I can provide is
to add your package to the list of those that should receive a
notification when uploading a new upstream version, see

     https://sources.debian.org/src/file/1%3A5.41-4/debian/README.Maintainer/#L16

If you want lintian to be included, just say the word.

Regards,

     Christoph


I can replicate this bug, but I'm currently having trouble understanding
why it happens. My current guess is that the perl regex we're using is
getting confused because the output of file's new version spits out octal
escape values that we're not sanitizing.

Lintian runs file (more precisely, `file --no-pad --print0 --print0 --`)
to get the "file_type" value of files [1].

Then, for all the files in "/usr/share/man/", it verifies .gz files are indeed
gz-compressed with this perl regex match [2]:

if ($item->file_type !~ m/gzip compressed data/)

I built the test files Lintian uses for the autopkgtest and when
I run file 1:5.43-3 on it, I do get an output that should match that regex:

---------------------------------------------
foo@bar:/tmp/foo/usr/share/man/man1# file -v
file-5.43
magic file from /etc/magic:/usr/share/misc/magic

foo@bar:/tmp/foo/usr/share/man/man1# file "鳥の詩.1.gz"
\351\263\245\343\201\256\350\251\251.1.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 145
---------------------------------------------

I then downgraded file to version 1:5.41-4 and I got a similar output,
but this time, with no octal escape?

---------------------------------------------
foo@bar:/tmp/foo/usr/share/man/man1# file -v
file-5.41
magic file from /etc/magic:/usr/share/misc/magic

foo@bar:/tmp/foo/usr/share/man/man1# file 鳥の詩.1.gz"
鳥の詩.1.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 145
---------------------------------------------

My perl-foo is pretty bad, but I guess we should be trying to espace or sanitize that value?
I also naively tried to install "fonts-noto", but that didn't help :)


[1]: https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Index/FileTypes.pm#L75

[2]: https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Check/Documentation/Manual.pm#L140

--
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁  Louis-Philippe Véronneau
  ⢿⡄⠘⠷⠚⠋   pollo@debian.org / veronneau.org
  ⠈⠳⣄

Attachment: OpenPGP_0xE1E5457C8BAD4113.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: