Nilesh Patra pushed to branch master at lintian / lintian


Commits:
7d7b866d by Nilesh Patra at 2026-05-07T19:51:28+05:30
Avoid "debian-watch-not-mangling-version" for CRAN or Bioconductor templates 
(Closes: #1135884)

CRAN and Bioconductor templates have dversion mangle already

https://salsa.debian.org/debian/devscripts/-/blob/main/lib/Devscripts/Uscan/Templates/Cran.pm
https://salsa.debian.org/debian/devscripts/-/blob/main/lib/Devscripts/Uscan/Templates/Bioconductor.pm

Thanks for Charles Plessy for reporting this and adding this in the
uscan templates.

- - - - -
0110d669 by Nilesh Patra at 2026-05-07T23:31:15+05:30
Add test to check CRAN templates do not get flagged for not mangling version

- - - - -


5 changed files:

- lib/Lintian/Check/Debian/Watch.pm
- + 
t/recipes/checks/debian/watch/watch-file-uses-cran-template/build-spec/debian/watch
- + 
t/recipes/checks/debian/watch/watch-file-uses-cran-template/build-spec/fill-values
- + t/recipes/checks/debian/watch/watch-file-uses-cran-template/eval/desc
- + t/recipes/checks/debian/watch/watch-file-uses-cran-template/eval/hints


Changes:

=====================================
lib/Lintian/Check/Debian/Watch.pm
=====================================
@@ -209,21 +209,26 @@ sub source {
 
         for my $option (@options) {
 
+            my $template = $EMPTY;
             if ($standard >= $CURRENT_WATCH_VERSION) {
                 chomp $option;
                 my ($key, $value) = split /:\s*/, $option, 2;
                 if ($key and $value) {
                     $key =~ s/-//g;
-                    $option = lc($key)."=$value";
+                    my $lc_key = lc($key);
+                    $option = $lc_key . "=$value";
+                    $template = $value if lc($key) eq 'template';
                 }
             }
 
             if (length $repack) {
                 $repack_mangle = 1
                   if $option
-                  =~ /^[ud]?versionmangle\s*=\s*(?:auto|.*$repack.*)/;
+                  =~ /^[ud]?versionmangle\s*=\s*(?:auto|.*$repack.*)/
+                  || $template =~ /(CRAN|Bioconductor)/i;
                 $repack_dmangle = 1
-                  if $option =~ /^dversionmangle\s*=\s*(?:auto|.*$repack.*)/;
+                  if $option =~ /^dversionmangle\s*=\s*(?:auto|.*$repack.*)/
+                  || $template =~ /(CRAN|Bioconductor)/i;
             }
 
             if (length $prerelease) {


=====================================
t/recipes/checks/debian/watch/watch-file-uses-cran-template/build-spec/debian/watch
=====================================
@@ -0,0 +1,5 @@
+Version: 5
+
+Template: CRAN
+Source: https://salsa.debian.org/foo/bar
+Matching-Pattern: refs/tags/@ANY_VERSION@


=====================================
t/recipes/checks/debian/watch/watch-file-uses-cran-template/build-spec/fill-values
=====================================
@@ -0,0 +1,5 @@
+Testname: watch-file-uses-cran-template
+Skeleton: upload-non-native
+Source-Format: 3.0 (quilt)
+Version: 1.0+dfsg-1
+Description: Package should not emit "debian-watch-not-mangling-version" for 
CRAN or Bioconductor uscan templates


=====================================
t/recipes/checks/debian/watch/watch-file-uses-cran-template/eval/desc
=====================================
@@ -0,0 +1,4 @@
+Testname: watch-file-uses-cran-template
+Test-Against:
+ debian-watch-not-mangling-version
+Check: debian/watch


=====================================
t/recipes/checks/debian/watch/watch-file-uses-cran-template/eval/hints
=====================================
@@ -0,0 +1 @@
+watch-file-uses-cran-template (source): 
debian-watch-does-not-check-openpgp-signature [debian/watch]



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

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