#1030193 lintian: Overriding for prefer-uscan-symlink is not possible

Package:
lintian
Source:
lintian
Submitter:
Joao Eriberto Mota Filho
Date:
2023-02-02 02:48:06 UTC
Severity:
normal
Tags:
#1030193#5
Date:
2023-02-01 01:55:53 UTC
From:
To:
Dear maintainer,

In my package obs-move-transition I needed to make an override using
filenamemangle[1][2] option.

[1] https://salsa.debian.org/debian/obs-move-transition/-/blob/debian/master/debian/watch
[2] https://salsa.debian.org/debian/obs-move-transition/-/commit/2482783eb472483f4cec0f0a330712aa6891e692

After this change[2], lintian said me:

X: obs-downstream-keyer source: prefer-uscan-symlink filenamemangle s/.*muted..([\d\.]+)..span./@PACKAGE@-$1\.tar\.gz/ [debian/watch:19]

After I make an override, litian said me:

W: obs-downstream-keyer source: mismatched-override prefer-uscan-symlink filenamemangle s/.*muted..([\d\.]+)..span./@PACKAGE@-$1\.tar\.gz/ [debian/watch:19] [debian/source/lintian-overrides:4]
X: obs-downstream-keyer source: prefer-uscan-symlink filenamemangle s/.*muted..([\d\.]+)..span./@PACKAGE@-$1\.tar\.gz/ [debian/watch:19]

Consequently, is not possible to make an override for prefer-uscan-symlink
filenamemangle. I think that lintian is interpreting my REGEX.

Regards,

Eriberto

#1030193#10
Date:
2023-02-02 02:44:23 UTC
From:
To:
Hi Eriberto,

Joao Eriberto Mota Filho wrote:
[…]

Can reproduce if I copy the emitted tag literally into
debian/source/lintian-overrides although it should work as override:

  prefer-uscan-symlink filenamemangle s/.*muted..([\d\.]+)..span./@PACKAGE@-$1\.tar\.gz/ [debian/watch:19]

With a bit of debug code (I added "die $re if $glob =~ /file/;" into
lib/Lintian/Utils.pm around line 404) it shows me that the override
was converted into this regular expression:

  filenamemangle s\/\..*muted\.\.\(\[\\d\.\]\+\)\.\.span\.\/\@PACKAGE\@\-\$1\.tar\.gz\/ \[debian\/watch\:19\]

Looks as expected to me on a first glance, but actually all occurences
of "\." are not properly converted to "\\\." while "\d" is properly
converted to "\\d". I can also reproduce with this minimal reproducer:

  $ perl -MRegexp::Wildcards -E 'my $rw = Regexp::Wildcards->new(type => "jokers"); say $rw->convert(q{\.\d})'
  \.\\d

So this actually seems to be a bug in libregexp-wildcards-perl. Hence
reassigning.

Sure it is, just replace all the ugly stuff with an asterisk or omit
all parameters after the tag name. All these overrides work for me:

  prefer-uscan-symlink filenamemangle s/*/ [debian/watch:19]
  prefer-uscan-symlink filenamemangle * [debian/watch:19]
  prefer-uscan-symlink filenamemangle *
  prefer-uscan-symlink

Yes and no. It interprets only "*" and "?" and these have the same
meaning as with shell wildcards. It's actually the "jokers" mode of
the Perl module Regexp::Wildcards.

		Regards, Axel