Skip to content
Commits on Source (17)
  • Chris Lamb's avatar
    Open new changelog entry. · 2c70b3f8
    Chris Lamb authored
    Gbp-Dch: ignore
    2c70b3f8
  • Chris Lamb's avatar
  • Chris Lamb's avatar
  • Chris Lamb's avatar
    Remove "busses" as a false-positive plural for "bus". Thanks to Jörg... · e6312df8
    Chris Lamb authored
    Remove "busses" as a false-positive plural for "bus". Thanks to Jörg Frings-Fürst for the report. (Closes: #934452)
    e6312df8
  • Felix Lechner's avatar
    Fix instructions on how to run the test suite. · 379ce51f
    Felix Lechner authored and Chris Lamb's avatar Chris Lamb committed
    This does not bring the documentation in line with all recent changes,
    but will hopefully avoid the worst vitriol from readers for its poor
    state.
    
    Fixes the instructions on how to run the test suite.
    
    Also marks the tutorials for writing tests and checks as out of date.
    
    Gbp-Dch: ignore
    379ce51f
  • Felix Lechner's avatar
    Abort lintian when tag definition is missing a 'Check:' stanza. · 26240c00
    Felix Lechner authored and Chris Lamb's avatar Chris Lamb committed
    The field 'Check' in tag definitions is new and mandatory, but the
    enforcing script t/scripts/tags/desc_fields.t does not run early
    enough to prevent problems even in other scripts (vs. tag-related
    tests). A proper solution requires a re-ordering of test scripts.
    
    As a start, this aborts Lintian and emits a meaningful error message.
    
    Gbp-Dch: ignore
    26240c00
  • Felix Lechner's avatar
    Attempt to fix irregular HTML display of package matlab-gdf in HTML output. (Re. #907425) · 348a9237
    Felix Lechner authored and Chris Lamb's avatar Chris Lamb committed
    As lamby pointed out, the package matlab-gdf that gave rise to the bug
    belongs to the section 'contrib/science'. The section is somewhat
    unusual because it uses a slash.
    
    No slash was present in the HTML page source (as one might expect for
    an unescaped character) and the output looked a little different from
    what was reported in the bug. (The version and the section were both
    absent.)  Nonetheless, this patch seemed like a reasonable attempt to
    resolve the bug. It is supposed to escape forward slashes to the HTML
    sequence '/' but it is untested.
    
    It looks like the archive component for individual packages runs
    through the routine html_quote, which is changed here, before being
    passed to Text::Template:
    
    https://salsa.debian.org/lintian/lintian/blob/master/commands/reporting-html-reports.pm#L1062
    
    This commit may or may not close the bug. It needs to be tested.
    
    Gbp-Dch: ignore
    348a9237
  • Felix Lechner's avatar
    Remove empty Test-Against: statements in test descriptions. · 5292931c
    Felix Lechner authored
    These statements have an effect only during test selection. The normal
    course of action should be, after editing a check, to use the check:
    selector to ensure your changes work as expected.
    
    You can also use the tag: selector, but that normally just invokes
    check: for the check the tag belongs to. Since the other tags in the
    check could interact with your selected tag, there is a reasonable
    assumption that they might interfere. To locate false positives, it is
    therefore best to run all related tests.
    
    The Test-Against: statements change that behavior. They are a holdover
    from when the test suite was focused on tags rather than checks. In an
    ideal situation, tests are specific to one tag and checks group only
    narrowly related tags. (Broad checks like 'files' and unfocused tests
    like 'manpages-general' are antithetical to the new design.) The
    Test-Against statements change which tests are run when a tag: is
    selected. That is all they do.
    
    Broad checks like 'files' group many unrelated tags. The tests
    intended for them are usually, but not always, a bit narrower. A
    Test-Against: statement says that the test at hand is a good indicator
    for false positives only for the listed tags. It prevents the test
    from running to find false positives for tags that do not appear in
    either 'tags' or Test-Against.
    
    The author would prefer to remove all Test-Against: statements. For
    that to happen, broad checks must be split into smaller pieces. An
    example would be to remove nodejs-related tags from the check 'files'.
    During that effort, Test-Against statements can be helpful to identify
    related tags. That's why Test-Against: is still around.
    
    Empty Test-Against statements do not serve that purpose. They only
    prevent tests from being run to look for false positive for tags other
    then the small subset calculated above.  Without it, all tests are run
    if they relate to the check the selected tag is in. Removing
    Test-Against simply results in more tests being run when the tag:
    selector is used. They do nothing else.
    
    Unfortunately, the content of the Test-Against: statements was never
    properly verified.  The semantics are unclear perhaps to anyone except
    the auther. The field is also of limited utility. Finally, the field's
    function is not what people may think from looking at old surviving
    documentation. The fields should go away when possible.
    
    We are keeping Test-Against: fields that have values so they can aid
    in debulking broad checks. The empty statements are herewith deleted.
    
    Gbp-Dch: ignore
    5292931c
  • Felix Lechner's avatar
    Acknowledge prior breakage due to new separate tags layout in d/control. · 06cddaef
    Felix Lechner authored
    The tags layout in separate files broke custom profiles in other
    packages. The packages pkg-perl-tools and pkg-js-tools use custom
    profiles that no longer work with recent version of Lintian.
    
    The reason is the separation of tags from checks in commit 083e8396
    and others.
    
    Both packages adjusted their custom profiles in recent uploads.
    Acknowledges the prior breakage in d/control.
    
    Please see Bug#934100 and Bug#934144 for details.
    
    Gbp-Dch: ignore
    06cddaef
  • Felix Lechner's avatar
    Fix two tests for debhelper update 12.4, which dropped manual sequencing commands. · f8fc4b51
    Felix Lechner authored
    Two tests fail to build in unstable because a new debhelper version
    there dropped support for manual sequencing. The relevant changelog
    entry is:
    
      * dh: Retroactively remove support for manual dh sequence
        operators (--until, --after, --before and --remaining).
        This breaks about 8 source packages that still rely on this
        feature and have not yet migrated away.  (Closes: #932537)
        Please see the debhelper bug for relevant bug numbers and
        package names.
    
    Two tests for the tag 'dh-manual-sequence-control-obsolete' could no
    longer built due to build failure. Removed the manual sequencing and
    adjusted the expected tags in both.
    
    If the tag 'dh-manual-sequence-control-obsolete' cannot be tested in
    another way, it will probably be removed from Lintian.
    
    Gbp-Dch: ignore
    f8fc4b51
  • Felix Lechner's avatar
    Remove tag 'dh-manual-sequence-control-obsolete' from Lintian; cannot be... · 62aa1ea0
    Felix Lechner authored
    Remove tag 'dh-manual-sequence-control-obsolete' from Lintian; cannot be tested due to debhelper changes.
    
    Debhelper 12.4 dropped support for manual sequencing. The relevant
    changelog entry is:
    
      * dh: Retroactively remove support for manual dh sequence
        operators (--until, --after, --before and --remaining).
        This breaks about 8 source packages that still rely on this
        feature and have not yet migrated away.  (Closes: #932537)
        Please see the debhelper bug for relevant bug numbers and
        package names.
    
    Source packages using the mechanism are now FTBFS. The mechanism was
    obsolete for some time and can no longer be used. It is untestable.
    
    Removes the tag and its check from Lintian.
    62aa1ea0
  • Yadd's avatar
  • Yadd's avatar
    Add a "nodejs-module-installed-in-usr-lib" tag to check if Node.JS modules are... · a369e104
    Yadd authored and Chris Lamb's avatar Chris Lamb committed
    Add a "nodejs-module-installed-in-usr-lib" tag to check if Node.JS modules are installed in the (correct) new location.
    a369e104
  • Chris Lamb's avatar
  • Chris Lamb's avatar
    Release lintian/2.18.0 into unstable. · 03a8fcfe
    Chris Lamb authored
    03a8fcfe
  • Chris Lamb's avatar
    Merge tag '2.18.0' into buster-backports · 71e4ea19
    Chris Lamb authored
    
    
    Release lintian/2.18.0 into unstable.
    
    Format: 1.8
    Date: Wed, 14 Aug 2019 15:56:02 +0000
    Source: lintian
    Architecture: source
    Version: 2.18.0
    Distribution: unstable
    Urgency: medium
    Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
    Changed-By: Chris Lamb's avatarChris Lamb <lamby@debian.org>
    Closes: 934452 934748
    Changes:
     lintian (2.18.0) unstable; urgency=medium
     .
       * Summary of tag changes:
         + Added:
           - nodejs-module-installed-in-usr-lib
         + Removed:
           - dh-manual-sequence-control-obsolete
     .
       [ Chris Lamb ]
       * Don't emit package-name-doesnt-match-sonames for udebs.
         (Closes: #934748)
       * Remove "busses" as a false-positive plural for "bus". Thanks to Jörg
         Frings-Fürst for the report. (Closes: #934452)
       * Recommend that maintainers do not override the
         "latest-debian-changelog-entry-changed-to-native" tag.
       * Don't emit changelog-file-missing-explicit-entry for uploads to the
         security archive (Re: #934026).
     .
       [ Felix Lechner ]
       * Remove the "dh-manual-sequence-control-obsolete" tag as it cannot
         be tested due to debhelper changes.
     .
       [ Xavier ]
       * Add a "nodejs-module-installed-in-usr-lib" tag to check if Node.js
         modules are installed in the (correct) new location.
       * Update the node-package-install-in-nodejs-rootdir test to search in all
         Node.js module directories.
    Checksums-Sha1:
     e377be7d51f167d0e533cfd0e5f4873ee1bf92ee 3047 lintian_2.18.0.dsc
     1a6a66d6d5ee7054622ce2a64c066953f64b60ec 1767468 lintian_2.18.0.tar.xz
     98db02ab7b026c896b4104428b1de98d4e4997bf 17644 lintian_2.18.0_amd64.buildinfo
    Checksums-Sha256:
     4b05b1fedf317edcd8af3d596cd5fd4e09d95c2987c0c74c0f305d44dd9f2d2c 3047 lintian_2.18.0.dsc
     b1bfa01db82910da8fb7e87e2d914d8fc59ee6c546a6f85ad1b84236a8c2f06e 1767468 lintian_2.18.0.tar.xz
     97de2e20d7322a3b2bd943cd6e8b77f85cc352f7c991268696a91114180366bc 17644 lintian_2.18.0_amd64.buildinfo
    Files:
     89c66b0e98b8ced1d4e0f0264ff9a750 3047 devel optional lintian_2.18.0.dsc
     dd796d558469f5322ad9616575141b81 1767468 devel optional lintian_2.18.0.tar.xz
     f6d0a7169e4e7750d83da2440517abed 17644 devel optional lintian_2.18.0_amd64.buildinfo
    
    * tag '2.18.0':
      Release lintian/2.18.0 into unstable.
      Don't emit package-name-doesnt-match-sonames for udebs. (Closes: #934748)
      Add a "nodejs-module-installed-in-usr-lib" tag to check if Node.JS modules are installed in the (correct) new location.
      Update the node-package-install-in-nodejs-rootdir test to search in all Node.JS module directories.
      Remove tag 'dh-manual-sequence-control-obsolete' from Lintian; cannot be tested due to debhelper changes.
      Fix two tests for debhelper update 12.4, which dropped manual sequencing commands.
      Acknowledge prior breakage due to new separate tags layout in d/control.
      Remove empty Test-Against: statements in test descriptions.
      Attempt to fix irregular HTML display of package matlab-gdf in HTML output. (Re. #907425)
      Abort lintian when tag definition is missing a 'Check:' stanza.
      Fix instructions on how to run the test suite.
      Remove "busses" as a false-positive plural for "bus". Thanks to Jörg Frings-Fürst for the report. (Closes: #934452)
      Don't emit changelog-file-missing-explicit-entry for uploads to the security archive (re. #934026).
      Recommend that maintainers do not override latest-debian-changelog-entry-changed-to-native.
      Open new changelog entry.
    71e4ea19
  • Chris Lamb's avatar
    Rebuild for buster-backports. · 28528805
    Chris Lamb authored
    28528805
......@@ -298,7 +298,7 @@ sub run {
}
tag 'package-name-doesnt-match-sonames', "@sonames"
if @sonames && !$match_found;
if @sonames && !$match_found && $type ne 'udeb';
# process all files in package
foreach my $file ($info->sorted_index) {
......
......@@ -346,7 +346,8 @@ sub run {
my $expected = substr($first_version, 0, -length($1));
tag 'changelog-file-missing-explicit-entry',
"$second_version -> $expected (missing) -> $first_version"
unless $second_version eq $expected;
unless $second_version eq $expected
or $entries[0]->Distribution =~ /-security$/i;
}
if ( $first_upstream eq $second_upstream
......
......@@ -174,9 +174,6 @@ sub run {
}
}
}
if (m/--(after|before|until|remaining)/) {
tag 'dh-manual-sequence-control-obsolete', 'dh', $1;
}
} elsif (m,^include\s+/usr/share/cdbs/1/rules/debhelper.mk,
or m,^include\s+/usr/share/R/debian/r-cran.mk,o) {
$build_systems{'cdbs-with-debhelper.mk'} = 1;
......
......@@ -821,10 +821,12 @@ sub run {
tag 'file-in-usr-lib-sgml', $file;
}
# ---------------- /usr/lib/node
elsif ($fname =~ m,^usr/lib/nodejs/,) {
if ($fname eq 'usr/lib/nodejs/package.json') {
tag 'node-package-install-in-nodejs-rootdir', $fname;
}elsif ($fname =~m,usr/lib/nodejs/[^/]*\.js$,) {
elsif ($fname =~ m,^usr/(?:share|lib(?:/[^/]+)?)/nodejs/,) {
tag 'nodejs-module-installed-in-usr-lib', $file
if $fname =~ m#usr/lib/nodejs/.*# and $file->is_file;
if ($fname
=~ m#usr/(?:share|lib(?:/[^/]+)?)/nodejs/(?:package\.json|[^/]*\.js)$#
) {
tag 'node-package-install-in-nodejs-rootdir', $fname;
}
}
......
......@@ -1128,6 +1128,9 @@ sub html_quote {
if (index($text, '>') > -1) {
$text =~ s/>/\&gt;/g;
}
if (index($text, '/') > -1) {
$text =~ s/\//\&#x2f;/g;
}
return $text;
}
......
......@@ -1280,7 +1280,6 @@ bumpded||bumped
bumpted||bumped
burocratic||bureaucratic
buss||bus
busses||buses
cacahe||cache
cacahes||caches
cacheed||cached
......
lintian (2.18.0~bpo10+1) buster-backports; urgency=medium
* Rebuild for buster-backports.
-- Chris Lamb <lamby@debian.org> Mon, 19 Aug 2019 12:29:40 -0700
lintian (2.18.0) unstable; urgency=medium
* Summary of tag changes:
+ Added:
- nodejs-module-installed-in-usr-lib
+ Removed:
- dh-manual-sequence-control-obsolete
[ Chris Lamb ]
* Don't emit package-name-doesnt-match-sonames for udebs.
(Closes: #934748)
* Remove "busses" as a false-positive plural for "bus". Thanks to Jörg
Frings-Fürst for the report. (Closes: #934452)
* Recommend that maintainers do not override the
"latest-debian-changelog-entry-changed-to-native" tag.
* Don't emit changelog-file-missing-explicit-entry for uploads to the
security archive (Re: #934026).
[ Felix Lechner ]
* Remove the "dh-manual-sequence-control-obsolete" tag as it cannot
be tested due to debhelper changes.
[ Xavier ]
* Add a "nodejs-module-installed-in-usr-lib" tag to check if Node.js
modules are installed in the (correct) new location.
* Update the node-package-install-in-nodejs-rootdir test to search in all
Node.js module directories.
-- Chris Lamb <lamby@debian.org> Wed, 14 Aug 2019 15:56:02 +0000
lintian (2.17.0~bpo10+1) buster-backports; urgency=medium
 
* Rebuild for buster-backports.
......@@ -146,7 +146,8 @@ Suggests:
libtext-template-perl,
Breaks:
funny-manpages (<< 1.3-5.1),
pkg-perl-tools (<< 0.23),
pkg-perl-tools (<< 0.53),
pkg-js-tools (<< 0.9.4),
Replaces:
funny-manpages (<< 1.3-5.1),
Multi-Arch: foreign
......
......@@ -6,6 +6,8 @@ Lintian::Tutorial::TestSuite -- Quick intro to running the Lintian testsuite
=head1 SYNOPSIS
Warning: This document may be out of date.
This guide will quickly introduce you to running the Lintian test
suite and some tricks. The Lintian test suite is fairly large and
accordingly it can take a substantial amount of time to run. To speed
......@@ -20,34 +22,21 @@ The Lintian test suite is an extensive collection of various test
cases. The test suite is divided into 4 "sub-suites". The majority
of tests are currently located in the "tests" sub-suite.
To run the full suite in all its glory, simply invoke:
$ debian/rules runtests
OR
To run the full suite:
$ mkdir -p debian/test-out
$ t/bin/runtests -k --dump-logs t debian/test-out
$ rm -rf debian/test-out; t/bin/build-test-packages; t/bin/runtests
While writing a new tag (or check) you probably only want to run a
particular (subset of the) test(s). See L</Running a subset of the
tests> for the available options.
When run via I<debian/rules>, the test suite respects
"DEB_BUILD_OPTIONS=parallel=N". When using I<t/bin/runtests> directly, use
I<-jN> to choose the number of threads. Note that "N" denotes the
amount of "worker" threads. The test runner will generally have 2
threads more than that. Also each "worker" will run lintian, which
runs multiple unpacking jobs in parallel as well.
=head2 Running a subset of the tests
In case you are wondering about the 2 extra threads in the test
runner, the first of them is the "coordinator" thread (which will
generally be waiting when the workers are active) and the second one
is the "output" thread (which handles the fancy output).
First, you have to build the test packages with:
=head2 Running a subset of the tests
$ rm -rf debian/test-out; t/bin/build-test-packages;
The following options are available:
Then, the following options are available:
=over 4
......@@ -55,59 +44,31 @@ The following options are available:
To run a single test by its name, use:
$ debian/rules runtests onlyrun=$name
OR
$ t/bin/runtests --dump-logs t debian/test-out $name
$ t/bin/runtests --onlyrun=test:$name
=item Running all tests for a check
To run all tests for a given check, use:
$ debian/rules runtests onlyrun=$check
OR
$ t/bin/runtests --dump-logs -k t debian/test-out $check
$ t/bin/runtests --onlyrun=check:$name
$check must be the name of a check (it will test for
checks/$check.desc) or "legacy". This will run all tests that start
with "$check-".
Note: The "changes" sub-suite in the new test suite does not support
this.
=item Running all tests in a sub-suite
To run all tests in a given sub-suite, use:
$ debian/rules runtests onlyrun=suite:$suites
OR
$ t/bin/runtests --dump-logs -k t debian/test-out suite:$suites
$suites is a comma-separated list of names of sub-suites to run.
Note: this cannot be used to influence the order in which the sub-suites
are run.
=item Running all tests designed for a specific tag
To run all tests that have a "Test-For" or a "Test-Against" for a given
tag, use:
$ debian/rules runtests onlyrun=tag:$tag
OR
$ t/bin/runtests --dump-logs -k t debian/test-out tag:$tag
$ t/bin/runtests --onlyrun=tag:$name
=back
=head2 Running tests under coverage
This feature is currently untested.
It is possible to run most of the tests under L<Devel::Cover>. This is
done by passing I<--coverage> to I<t/bin/runtests>. Example:
......
......@@ -6,6 +6,8 @@ Lintian::Tutorial::WritingChecks -- Writing checks for Lintian
=head1 SYNOPSIS
Warning: This tutorial may be outdated.
This guide will quickly guide you through the basics of writing a
Lintian check. Most of the work is in writing the two files:
......
......@@ -6,6 +6,8 @@ Lintian::Tutorial::WritingTests -- Short tutorial on writing tests
=head1 SYNOPSIS
Warning: This document may be out of date.
This document attempts to be a short / quick tutorial to the Lintian
test suite from a test-writer's perspective. As such, it will only
cover the standard type of tests (from the "tests" suite).
......@@ -32,18 +34,25 @@ They are B<not> used for testing Lintian tags.
=item -
changes / debs / source
tags
These tests all test for the presence of tags after building test
packages using skeletons. For most cases, we recommend
These suites are small test suites that test some particular tags for
Skeleton: upload-non-native
suites are small test suites that test some particular tags for
I<.changes>, I<.deb> or I<.dsc> files. Typically, you will find the
more exotic tags here, which require some special fiddling and cannot
be built by a "standard" dh7 + dpkg build.
=item -
tests
literal
This suite is the standard test suite for testing Lintian tags.
These tests look to match the literal output of Lintian. These tests
are useful as general false positives. They also catch Lintian messages
unrelated to tags.
=back
......@@ -51,6 +60,8 @@ With this in mind, let us move on to the scope.
=head2 Scope of the tutorial
WARNING: THE REMAINDER OF THIS TUTORIAL IS OUT OF DATE.
The "tests" suite alone is fairly complex on its own. To keep things
simple, the tutorial will limit itself to creating a "native"
package with no special requirements in the "tests" suite.
......
......@@ -158,6 +158,9 @@ sub new {
my $taginfo = Lintian::Tag::Info->new;
$taginfo->load($tagpath);
die "Tag in $tagpath is not associated with a check"
unless length $taginfo->script;
unless (exists $self->{'known-tags'}{$taginfo->tag}) {
$self->{'known-tags'}{$taginfo->tag} = $taginfo;
push(
......
......@@ -2,5 +2,4 @@ Skeleton: upload-native
Testname: apache2-modules-general
Version: 1.0
Description: Several tests related to Apache2 module packages
Test-Against:
Check: apache2
......@@ -2,5 +2,4 @@ Skeleton: upload-native
Testname: apache2-webapplications-general
Version: 1.0
Description: Several tests related to Apache2 web application packages
Test-Against:
Check: apache2
......@@ -2,5 +2,4 @@ Skeleton: upload-native
Testname: appstream-metadata
Version: 1.0
Description: Test AppStream and udev metadata in binary package
Test-Against:
Check: appstream-metadata
......@@ -4,5 +4,4 @@ Version: 1.0
Description: Test for development packages shipping ELF binaries in $PATH
Default-Build-Depends: debhelper (>= 9.20160114~)
Dh-Compat-Level: 9
Test-Against:
Check: binaries
......@@ -4,5 +4,4 @@ Version: 1.0
Default-Build-Depends: debhelper (>= 9.20151004~)
Dh-Compat-Level: 9
Description: Test for library package that does not match SONAME
Test-Against:
Check: binaries
......@@ -3,5 +3,4 @@ Testname: binaries-embedded-libs
Package-Architecture: any
Version: 1.0
Description: Package with binary with library-unique strings
Test-Against:
Check: binaries
......@@ -4,5 +4,4 @@ Test-Architectures: amd64 i386
Package-Architecture: any
Version: 1.0
Description: Test package with a pseudo binary from a different architecture
Test-Against:
Check: binaries
......@@ -3,5 +3,4 @@ Testname: binaries-general
Version: 1.0
Description: Misc errors related to binaries
Package-Architecture: any
Test-Against:
Check: binaries