[devscripts] 02/05: uscan: Better @ANY_VERSION@ regex

Osamu Aoki osamu at moszumanska.debian.org
Thu May 5 11:00:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

osamu pushed a commit to branch master
in repository devscripts.

commit 47b0bd26dd9bcdee7bddaba064aad8b063f18f0b
Author: Osamu Aoki <osamu at debian.org>
Date:   Thu May 5 18:03:06 2016 +0900

    uscan: Better @ANY_VERSION@ regex
    
    Closes: #821224
    
    Also touch on the same purpose regex
---
 debian/changelog | 1 +
 scripts/uscan.pl | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ed1f708..31b9c7b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ devscripts (2.16.5) UNRELEASED; urgency=medium
   [ Osamu Aoki ]
   * uscan:
     + No output if upstream == debian and no errors.  (Closes: #820798)
+    + Better @ANY_VERSION@ regex.  (Closes: #821224)
 
  -- James McCoy <jamessan at debian.org>  Mon, 02 May 2016 19:41:06 -0400
 
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 1e64928..18b080c 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -256,7 +256,7 @@ F<debian/changelog> file.
 
 This is substituted by the legal upstream version regex (capturing).
 
-  [-_](\d[\-+\.:\~\da-zA-Z]*)
+  [-_]?(\d[\-+\.:\~\da-zA-Z]*)
 
 =item B<@ARCHIVE_EXT@>
 
@@ -3273,7 +3273,7 @@ EOF
 	}
 	unless ($newversion) {
 	    # uversionmanglesd version is '', make best effort to set it
-	    $newfile_base =~ m/^.+[-_]([^-_]+)(?:\.tar\.(gz|bz2|xz)|\.zip)$/i;
+	    $newfile_base =~ m/^.+[-_]?(\d[\-+\.:\~\da-zA-Z]*)(?:\.tar\.(gz|bz2|xz)|\.zip)$/i;
 	    $newversion = $1;
 	    unless ($newversion) {
 		uscan_warn "Fix filenamemangle to produce a filename with the correct version\n";
@@ -4158,7 +4158,7 @@ sub process_watchfile ($$$$)
 	s/\\\\/\\/g if $watch_version==1;
 
 	# Handle @PACKAGE@ @ANY_VERSION@ @ARCHIVE_EXT@ substitutions
-	my $any_version = '[-_](\d[\-+\.:\~\da-zA-Z]*)';
+	my $any_version = '[-_]?(\d[\-+\.:\~\da-zA-Z]*)';
 	my $archive_ext = '(?i)\.(?:tar\.xz|tar\.bz2|tar\.gz|zip)';
 	my $signature_ext = $archive_ext . '\.(?:asc|pgp|gpg|sig)';
 	s/\@PACKAGE\@/$package/g;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list