#1013873 lintian: "Cannot open" warnings on symlinks to files in other packages from same source

#1013873#5
Date:
2022-06-26 12:02:16 UTC
From:
To:
Hello,

lintian has recently started throwing errors like this for when run on
exim4_..._amd64.changes (source + binary upload):
------------------

The respective file is a symlink to the file in exim4-base/:
(sid)ametzler@argenau:/tmp/EXIM4/exim-4.96$ ls -l debian/exim4-daemon-heavy/usr/share/doc/exim4-daemon-heavy/README.Debian.gz
lrwxrwxrwx 1 ametzler ametzler 30 Jun 26 11:53 debian/exim4-daemon-heavy/usr/share/doc/exim4-daemon-heavy/README.Debian.gz -> ../exim4-base/README.Debian.gz

cu Andreas

#1013873#10
Date:
2022-06-27 15:32:09 UTC
From:
To:
Hi Andreas,

Andreas Metzler wrote:

Interesting. Thanks for the bug report!

Since ../exim4-base/README.Debian.gz is actually existing, I wonder if
that "<:gzip" in

    109             open($fd, '<:gzip', $item->unpacked_path)

plays a role here. My current guess is that there is a "use
PerlIO::gzip;" missing in lib/Lintian/Check/Debian/Readme.pm since it
it seems required to make "<:gzip" work (wonder why it does only spew
runtime warnings because of that and doesn't bail out at compile time
already) and it is present in quite some other Lintian Perl modules:

~/lintian/lintian → git grep PerlIO::gzip
lib/Lintian/Data/Debhelper/Addons.pm:use PerlIO::gzip;
lib/Lintian/Data/Debhelper/Commands.pm:use PerlIO::gzip;
lib/Lintian/Data/Fonts.pm:use PerlIO::gzip;
lib/Lintian/Data/InitD/VirtualFacilities.pm:use PerlIO::gzip;
lib/Lintian/Processable/Installable/Overrides.pm:use PerlIO::gzip;
~/lintian/lintian →

Will check. And if I'm right with my guess, I'll likely will write a
test first for this type of bug as there are quite some more such
cases:

~/lintian/lintian → git grep -Fl '<:gzip' | xargs fgrep -L 'use PerlIO::gzip;'
lib/Lintian/Check/Debian/Readme.pm
lib/Lintian/Check/Documentation.pm
lib/Lintian/Check/Documentation/Manual.pm
lib/Lintian/Check/Documentation/Texinfo.pm
lib/Lintian/Check/Languages/Fortran/Gfortran.pm
lib/Lintian/Check/Languages/R.pm
lib/Lintian/Data/Authority/DocBaseManual.pm
lib/Lintian/Data/Authority/VimPolicy.pm
~/lintian/lintian →

Raising severity to important because this issue has quite some impact
if my guess above is correct.

		Regards, Axel