On Sun, Oct 04, 2015 at 01:33:06PM +0000, Osamu Aoki wrote:
> diff --git a/scripts/uscan.pl b/scripts/uscan.pl
> index 4736177..277bd86 100755
> --- a/scripts/uscan.pl
> +++ b/scripts/uscan.pl
> @@ -3446,9 +3446,9 @@ sub newest_dir ($$$$$) {
> if (defined $download_version) {
> print STDERR "$progname debug: download version requested:
> $download_version\n" if $debug;
> if ($download_version =~
> m/^([-~\+\w]+)(\.[-~\+\w]+)?(\.[-~\+\w]+)?(\.[-~\+\w]+)?$/) {
> - $download_version_short1 = "$1";
> - $download_version_short2 = "$1$2";
> - $download_version_short3 = "$1$2$3";
> + $download_version_short1 = "$1" if defined $1;
> + $download_version_short2 = "$1$2" if defined $2;
> + $download_version_short3 = "$1$2$3" if defined $3;
What about something like this?
if ($download_version =~ m/^[-~+\w]+(?:\.[-~+\w]+){0,3}$/) {
($download_version_short1,
$download_version_short2,
$download_version_short3) = split(/\./, $download_version);
}
Cheers,
--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>
_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel