Package: devscripts
Version: 2.25.22~bpo13+1
Severity: important
Dear Maintainer,
using the new Version 5 debian/watch format with Template: Metacpan
does not skip leading "v" from the upstream version number.
Take for example libfile-loadlines-perl with the following watch file:
Version: 5
Template: Metacpan
Dist: File-LoadLines
This results in uscan --report-status (stripped some lines):
uscan info: Process watch file at: debian/watch
package = libfile-loadlines-perl
version = 1.047
uscan info: Parsing versiontype: (?:[-_]?[Vv]?(\d[\-+\.:\~\da-zA-Z]*))
uscan info: Last orig.tar.* tarball version (from debian/changelog): 1.047
uscan info: Last orig.tar.* tarball version (dversionmangled): 1.047
uscan info: Searching versions of File-LoadLines
uscan info: Found the following matching files on the web page (newest first):
https://cpan.metacpan.org/authors/id/J/JV/JV/File-LoadLines-1.020.2.tar.gz
(v1.020.2) index=v1.020.2-1
https://cpan.metacpan.org/authors/id/J/JV/JV/File-LoadLines-1.020.1.tar.gz
(v1.020.1) index=v1.020.1-1
https://cpan.metacpan.org/authors/id/J/JV/JV/File-LoadLines-1.047.tar.gz
(1.047) index=1.047-1
https://cpan.metacpan.org/authors/id/J/JV/JV/File-LoadLines-1.046.tar.gz
(1.046) index=1.046-1
https://cpan.metacpan.org/authors/id/J/JV/JV/File-LoadLines-1.045.tar.gz
(1.045) index=1.045-1
[...]
uscan info: Looking at $base = File-LoadLines with
$filepattern =
https://cpan.metacpan.org/.*File-LoadLines-(?:[-_]?[Vv]?(\d[\-+\.:\~\da-zA-Z]*))(?i)(?:\.(?:tar\.xz|tar\.bz2|tar\.gz|tar\.zstd?|zip|tgz|tbz|txz))
found
$newfile =
https://cpan.metacpan.org/authors/id/J/JV/JV/File-LoadLines-1.020.2.tar.gz
$mangled_newversion = v1.020.2
$newversion = v1.020.2
$lastversion = 1.047
As you can see, sometimes the versions on CPAN are prefixed with "v"
and MetaCPAN::Client shows them in the version number.
The old version 4 CPAN default watch file ignored this "v":
version=4
https://metacpan.org/release/File-LoadLines
.*/File-LoadLines-v?@ANY_VERSION@@ARCHIVE_EXT@$
but the new Metacpan template does not do so.
Currently I work around this issue by adding
Uversionmangle: s/^v//
but it would be better to strip the leading "v" in the template, since
this seems to be a problem on multiple CPAN packages.
I think that this issue is similar to https://bugs.debian.org/1113795,
which reports the same problem for gitlab templates.
Greetings
Roland