Control: tags -1 + patch

On Thu, Aug 17, 2023 at 01:13:05PM +0200, Philipp Huebner wrote:
> 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.

So the issue is that these "automatic" overrides aren't actually
overrides internally, but "masks".  Lintian's default EWI output treats
masked and overridden tags similarly, in terms of display priority, but
does not treat them the same when it comes to the fail-on parameter.

The following patch changes lintian to treat masks like overrides when
counting reported tags.  With this patch applied, tags that are masked
internally no longer count as reported, so they don't trigger "fail-on"
for different severities.  Note that it specifically does *not* trigger
'--fail-on override'.  That would be easy to implement, but I don't
think it's the right thing to do, as a masked tag is not really under a
package maintainer's control and doesn't indicate anything that they've
specifically enabled in their package.

This is a slight change in behavior, but I think it's a reasonable one.
The existence of this bug highlights how confusing the current behavior
can be.

>From dca99e1438ef25518bbb440ceb2e7c540f5a14b1 Mon Sep 17 00:00:00 2001
From: Noah Meyerhans <[email protected]>
Date: Tue, 13 Oct 2026 14:35:48 -0400
Subject: [PATCH] don't count masked tags as reported

Closes: #1031878
---
 lib/Lintian/Pool.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Lintian/Pool.pm b/lib/Lintian/Pool.pm
index db153f989..f7c0157b7 100644
--- a/lib/Lintian/Pool.pm
+++ b/lib/Lintian/Pool.pm
@@ -191,7 +191,7 @@ sub process{
                 next
                   unless $PROFILE->display_level_for_tag($hint->tag_name);
 
-                if (!defined $hint->override) {
+                if (!defined $hint->override && !@{$hint->masks}) {
 
                     ++$reported_count{$tag->visibility}
                       if !$tag->experimental;
-- 
2.47.3

Reply via email to