Nilesh Patra pushed to branch master at lintian / lintian


Commits:
9f1fba5b by Nilesh Patra at 2026-05-12T19:58:20+05:30
Update regex to match the correct policy version in d/ch when 4 version 
component is used (Closes: #1135883)

Current regex incorrectly matches 4.7.4.1 as 7.4.1 for instance.

Thanks to James Montgomery for reporting this.

- - - - -
d39298c2 by Nilesh Patra at 2026-05-12T19:58:20+05:30
Add test to ensure we detect four component standards version correctly

- - - - -


6 changed files:

- lib/Lintian/Check/Fields/StandardsVersion.pm
- + 
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/build-spec/debian/changelog.in
- + 
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/build-spec/debian/control.in
- + 
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/build-spec/fill-values
- + 
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/eval/desc
- + 
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/eval/hints


Changes:

=====================================
lib/Lintian/Check/Fields/StandardsVersion.pm
=====================================
@@ -98,7 +98,7 @@ sub source {
         my $changes = $entry->Changes;
 
         if ($changes
-            =~ /(?:standards[ 
-]?version|\bs-v:?\s).*\b(\d+\.\d+\.\d+)\b(?!.*\b\d+\.\d+\.\d+\b)/i
+            =~ /(?:standards[ 
-]?version|\bs-v:?\s).*?\b(\d+\.\d+\.\d+)(?:\.\d+)?\b(?!.*\b\d+\.\d+\.\d+(?:\.\d+)?\b)/i
         ) {
             my $changelog_standard = $1;
 


=====================================
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/build-spec/debian/changelog.in
=====================================
@@ -0,0 +1,6 @@
+[% $source %] ([% $version %]) [% $distribution %]; urgency=low
+
+  * Test: [% $testname %]
+  * Bump Standards-Version to 4.7.4.1.
+
+ -- [% $author %]  [% $date %]


=====================================
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/build-spec/debian/control.in
=====================================
@@ -0,0 +1,15 @@
+Source: [% $source %]
+Section: devel
+Maintainer: [% $author %]
+Standards-Version: 4.6.0.1
+Build-Depends: [% $build_depends %]
+Homepage: https://lintian.debian.org/
+
+Package: [% $source %]
+Architecture: [% $package_architecture %]
+Depends: ${shlibs: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/standards-version/standards-version-inconsistent-four-comp/build-spec/fill-values
=====================================
@@ -0,0 +1,3 @@
+Skeleton: upload-native
+Testname: standards-version-inconsistent-four-comp
+Description: Test standards version inconsistency between control and 
changelog with 4 point versions


=====================================
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/eval/desc
=====================================
@@ -0,0 +1,2 @@
+Testname: standards-version-inconsistent-four-comp
+Check: fields/standards-version


=====================================
t/recipes/checks/fields/standards-version/standards-version-inconsistent-four-comp/eval/hints
=====================================
@@ -0,0 +1,3 @@
+standards-version-inconsistent-four-comp (source): 
standards-version-inconsistent 4.6.0 != 4.7.4
+standards-version-inconsistent-four-comp (source): standards-version 4.6.0.1
+standards-version-inconsistent-four-comp (source): 
out-of-date-standards-version 4.6.0.1 (released 2021-08-18) (current is 4.7.4)



View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/compare/0110d669f923678422ec724414b4a8e49ac217ad...d39298c277ab1f07c53000cad7b758682e381086

-- 
View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/compare/0110d669f923678422ec724414b4a8e49ac217ad...d39298c277ab1f07c53000cad7b758682e381086
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


Reply via email to