Felix Lechner pushed to branch master at lintian / lintian


Commits:
713a39dd by Felix Lechner at 2022-01-13T07:30:09-08:00
Mask long source lines in autotools-generated files. (Closes: #996740)

> configure and m4/libtool.m4 may be the only ones that
> trigger this; I haven't done any further research.

All m4 macros were included, because they usually originate with third parties.
We also included any Makefile.in, in any folder, when a Makefile.am is present.
For details, please have a look at the commit diff.

The output for libpam-krb5 is attached below.

Please be patient to see the positive impact your suggestion may have. You will
not yet see the scope of the mask across the archive on the website right away.
The cruft check that issues is the tag is presently disabled there due to an
unrelated malfunction. [1]

We hope to sever unrelated tags from the cruft check in the near future. At
that point the true value of your thoughtful suggestion will become known to the
whole world.

Thanks to Russ Allbery for bringing the matter to our attention!

[1] https://bugs.debian.org/993613

➤ bin/lintian /mirror/debian/pool/main/libp/libpam-krb5/libpam-krb5_4.11-1.dsc
N: masked by screen autotools/long-lines
M: libpam-krb5 source: very-long-line-length-in-source-file line 13223 is 704 
characters long (>512) [configure]
N: masked by screen autotools/long-lines
M: libpam-krb5 source: very-long-line-length-in-source-file line 6627 is 738 
characters long (>512) [m4/libtool.m4]

- - - - -


2 changed files:

- + lib/Lintian/Screen/Autotools/LongLines.pm
- tags/v/very-long-line-length-in-source-file.tag


Changes:

=====================================
lib/Lintian/Screen/Autotools/LongLines.pm
=====================================
@@ -0,0 +1,61 @@
+# Copyright © 2021 Felix Lechner
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::Screen::Autotools::LongLines;
+
+use v5.20;
+use warnings;
+use utf8;
+
+use Moo;
+use namespace::clean;
+
+with 'Lintian::Screen';
+
+sub suppress {
+    my ($self, $processable, $hint) = @_;
+
+    my $item = $hint->pointer->item;
+
+    # ./configure script in source root only
+    return 1
+      if $item->name eq 'configure'
+      && ( defined $processable->patched->resolve_path('configure.in')
+        || defined $processable->patched->resolve_path('configure.ac'));
+
+    # Automake's Makefile.in in any folder
+    return 1
+      if $item->basename eq 'Makefile.in'
+      && defined $processable->patched->resolve_path(
+        $item->dirname . '/Makefile.am');
+
+    # any m4 macro as long as ./configure is present
+    return 1
+      if $item->name =~ m{^ m4/ }x
+      && defined $processable->patched->resolve_path('configure');
+
+    return 0;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 sr et


=====================================
tags/v/very-long-line-length-in-source-file.tag
=====================================
@@ -20,3 +20,22 @@ Explanation: The source file includes a line length that is 
well beyond
  You may report this issue upstream.
 Renamed-From:
  insane-line-length-in-source-file
+
+Screen: autotools/long-lines
+Advocates: Russ Allbery <r...@debian.org>
+Reason:
+ Upstream sources using <code>autoconf</code> have traditionally been
+ distributed with generated <code>./configure<code> scripts as well as
+ other third-party <code>m4</code> macro files such as <code>libtool</code>.
+ .
+ When paired with <code>automake</code>, there may also be some intermediate
+ <code>Makefile.in</code> files.
+ .
+ A lot of sources potentially contain such files, but they are not actionable
+ by either the Debian distributor or by the upstream maintainer.
+ .
+ As a side note, modern Debian build protocols will re-create many of those
+ files via <code>dh_autoreconf</code>. They are present merely to aid in
+ bootstrapping systems where the GNU suite may not yet be available.
+See-Also:
+ Bug#996740



View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/commit/713a39dd130cdb535fec8dfb20a0974f94f16471

-- 
View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/commit/713a39dd130cdb535fec8dfb20a0974f94f16471
You're receiving this email because of your account on salsa.debian.org.


Reply via email to