#1031878 --fail-on warnings fails overrides even though --fail-on overrides is not specified

Package:
lintian
Source:
lintian
Submitter:
Daniel Kauffman
Date:
2023-08-17 11:21:03 UTC
Severity:
normal
Tags:
#1031878#5
Date:
2023-02-24 16:01:30 UTC
From:
To:
Version: 2.104.0

Running `lintian --fail-on warnings` on a package which overrides all
warnings in debian/lintian-overrides unexpectedly returns exit code 2.
Expected behavior is for this command to return exit code 0 unless
`lintian --fail-on overrides` is also specified.

Reading `man lintian` implies that `lintian --fail-on warnings` and
`lintian --fail-on overrides` should have distinct behaviors. However,
`lintian --fail-on warnings` seems to behave as if `lintian --fail-on
warnings,overrides` were specified instead.

If `lintian --fail-on warnings` should always fail on warnings, even
when debian/lintian-overrides overrides these warnings, the
documentation should probably be clarified. However, this behavior
leaves no way to check that a package having one or more overrides has
no additional issues.

I run lintian as part of my build process. I'd like to fail the build if
lintian finds issues with either the source package or the binary
package. Currently, if I use --fail-on, and the package has any
overrides, lintian always returns exit code 2. And if I don't use
--fail-on, lintian always returns exit code 0. I seem to be unable to 
have lintian return a non-zero exit code only when a package has an
issue that has not yet been fixed or overridden. Using
--ftp-master-rejects might return such an exit code, however, such an 
exit code is not documented and would prevent using a --profile.

Same discussion applies for `--fail-on errors` etc.

Thanks,
Daniel Kauffman
Business Experience Designer
Rock Solid Solutions LLC

#1031878#14
Date:
2023-08-17 11:13:05 UTC
From:
To:
Hi,

today I ran into the same issue on Bookworm.

What was strange though: some packages hit this bug, others did not.

Turns out it is related to "automatic" overrides being present or not.
A python package of mine had automatic overrides for
"package-contains-documentation-outside-usr-share-doc
[usr/lib/python3/dist-packages/PackageName-Version.egg-info*]"

The --show-overrides option (hitting #1019690 here) said:
"N: masked by screen python/egg/metadata"

After adding explicit overrides in the package the --fail-on function
worked correctly again and I got exit code 0 instead of 2.


Hope this helps!

Best wishes