Nilesh Patra pushed to branch master at lintian / lintian
Commits:
97b9e042 by Nilesh Patra at 2026-07-28T22:30:03+02:00
Lintian::Check::Fields::Unknown - Drop prefix starting with X (XS-*, XSBC-*
etc) as the fields in `.dsc` strips them off (Closes: #1029471, #1013414)
- - - - -
61390299 by Nilesh Patra at 2026-07-28T22:30:04+02:00
tests(fields-unknown-autobuild-unrel): Add test to ensure XS-Autobuild does not
spawn unknown-field (to test against #1013414)
- - - - -
5 changed files:
- lib/Lintian/Check/Fields/Unknown.pm
- +
t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/build-spec/debian/control.in
- +
t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/build-spec/fill-values
- + t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/eval/desc
- + t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/eval/hints
Changes:
=====================================
lib/Lintian/Check/Fields/Unknown.pm
=====================================
@@ -35,23 +35,21 @@ use namespace::clean;
with 'Lintian::Check';
-# Whitelist of XS-* source fields
-my %source_field_whitelist = (
- 'Autobuild' => 1,
- 'Go-Import-Path' => 1,
- 'Ruby-Versions' => 1,
-);
-
sub source {
my ($self) = @_;
my $KNOWN_SOURCE_FIELDS= $self->data->load('common/source-fields');
+ my @known_source_fields_sanitized;
+ for my $field ($KNOWN_SOURCE_FIELDS->all_entries) {
+ my ($marker, $bare) = split(qr{-}, $field, 2);
+
+ push @known_source_fields_sanitized,
+ ($marker =~ m{^ X}x ? $bare : $field);
+ }
my @unknown
- = $self->processable->fields->extra($KNOWN_SOURCE_FIELDS->all_entries);
+ = $self->processable->fields->extra(@known_source_fields_sanitized);
- # The grep filter is a workaround for #1014885 and #1029471
- $self->hint('unknown-field', $_)
- for grep { !exists($source_field_whitelist{$_}) } @unknown;
+ $self->hint('unknown-field', $_)for @unknown;
return;
}
=====================================
t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/build-spec/debian/control.in
=====================================
@@ -0,0 +1,17 @@
+Source: [% $source %]
+Priority: optional
+Section: non-free/[% $section %]
+Maintainer: [% $author %]
+Standards-Version: [% $standards_version %]
+Build-Depends: [% $build_depends %]
+Rules-Requires-Root: no
+XS-Autobuild: no
+
+Package: [% $source %]
+Architecture: [% $package_architecture %]
+Depends: ${misc:Depends}
+Description: [% $description %]
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
=====================================
t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/build-spec/fill-values
=====================================
@@ -0,0 +1,3 @@
+Skeleton: upload-non-native
+Testname: fields-unknown-autobuild-unrel
+Description: Check XS-Autobuild does not spawn unknown-field
=====================================
t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/eval/desc
=====================================
@@ -0,0 +1,3 @@
+Testname: fields-unknown-autobuild-unrel
+Check: fields/unknown
+Test-Against: unknown-field
=====================================
t/recipes/checks/fields/unknown/fields-unknown-autobuild-unrel/eval/hints
=====================================
View it on GitLab:
https://salsa.debian.org/lintian/lintian/-/compare/2745bd61c567fd38c346007a41c04d92c0955621...613902994327ff524d87f8c786a493b36ca12fb4
--
View it on GitLab:
https://salsa.debian.org/lintian/lintian/-/compare/2745bd61c567fd38c346007a41c04d92c0955621...613902994327ff524d87f8c786a493b36ca12fb4
You're receiving this email because of your account on salsa.debian.org. Manage
all notifications: https://salsa.debian.org/-/profile/notifications | Help:
https://salsa.debian.org/help