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

[Git][lintian/lintian][master] Mask long source lines in autotools-generated files. (Closes: #996740)



Title: GitLab

Felix Lechner pushed to branch master at lintian / lintian

Commits:

2 changed files:

Changes:

  • lib/Lintian/Screen/Autotools/LongLines.pm
    1
    +# Copyright © 2021 Felix Lechner
    
    2
    +#
    
    3
    +# This program is free software; you can redistribute it and/or modify
    
    4
    +# it under the terms of the GNU General Public License as published by
    
    5
    +# the Free Software Foundation; either version 2 of the License, or
    
    6
    +# (at your option) any later version.
    
    7
    +#
    
    8
    +# This program is distributed in the hope that it will be useful,
    
    9
    +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    10
    +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    11
    +# GNU General Public License for more details.
    
    12
    +#
    
    13
    +# You should have received a copy of the GNU General Public License
    
    14
    +# along with this program.  If not, you can find it on the World Wide
    
    15
    +# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
    
    16
    +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
    
    17
    +# MA 02110-1301, USA.
    
    18
    +
    
    19
    +package Lintian::Screen::Autotools::LongLines;
    
    20
    +
    
    21
    +use v5.20;
    
    22
    +use warnings;
    
    23
    +use utf8;
    
    24
    +
    
    25
    +use Moo;
    
    26
    +use namespace::clean;
    
    27
    +
    
    28
    +with 'Lintian::Screen';
    
    29
    +
    
    30
    +sub suppress {
    
    31
    +    my ($self, $processable, $hint) = @_;
    
    32
    +
    
    33
    +    my $item = $hint->pointer->item;
    
    34
    +
    
    35
    +    # ./configure script in source root only
    
    36
    +    return 1
    
    37
    +      if $item->name eq 'configure'
    
    38
    +      && ( defined $processable->patched->resolve_path('configure.in')
    
    39
    +        || defined $processable->patched->resolve_path('configure.ac'));
    
    40
    +
    
    41
    +    # Automake's Makefile.in in any folder
    
    42
    +    return 1
    
    43
    +      if $item->basename eq 'Makefile.in'
    
    44
    +      && defined $processable->patched->resolve_path(
    
    45
    +        $item->dirname . '/Makefile.am');
    
    46
    +
    
    47
    +    # any m4 macro as long as ./configure is present
    
    48
    +    return 1
    
    49
    +      if $item->name =~ m{^ m4/ }x
    
    50
    +      && defined $processable->patched->resolve_path('configure');
    
    51
    +
    
    52
    +    return 0;
    
    53
    +}
    
    54
    +
    
    55
    +1;
    
    56
    +
    
    57
    +# Local Variables:
    
    58
    +# indent-tabs-mode: nil
    
    59
    +# cperl-indent-level: 4
    
    60
    +# End:
    
    61
    +# 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
    20 20
      You may report this issue upstream.
    
    21 21
     Renamed-From:
    
    22 22
      insane-line-length-in-source-file
    
    23
    +
    
    24
    +Screen: autotools/long-lines
    
    25
    +Advocates: Russ Allbery <rra@debian.org>
    
    26
    +Reason:
    
    27
    + Upstream sources using <code>autoconf</code> have traditionally been
    
    28
    + distributed with generated <code>./configure<code> scripts as well as
    
    29
    + other third-party <code>m4</code> macro files such as <code>libtool</code>.
    
    30
    + .
    
    31
    + When paired with <code>automake</code>, there may also be some intermediate
    
    32
    + <code>Makefile.in</code> files.
    
    33
    + .
    
    34
    + A lot of sources potentially contain such files, but they are not actionable
    
    35
    + by either the Debian distributor or by the upstream maintainer.
    
    36
    + .
    
    37
    + As a side note, modern Debian build protocols will re-create many of those
    
    38
    + files via <code>dh_autoreconf</code>. They are present merely to aid in
    
    39
    + bootstrapping systems where the GNU suite may not yet be available.
    
    40
    +See-Also:
    
    41
    + Bug#996740


  • Reply to: