Bug#869150: /usr/bin/uscan: doesn't find the correct version for directory based version detection
Osamu Aoki
osamu at debian.org
Fri Jul 28 14:24:44 UTC 2017
Oops
I am not much of perl speaker ...
On Fri, Jul 28, 2017 at 11:14:01PM +0900, Osamu Aoki wrote:
> On Thu, Jul 20, 2017 at 07:30:35PM -0400, Paul Gevers wrote:
...
> > I don't know enough perl to know how to do it, but I think that the
> > expression for the version in the next line isn't greedy (I found this
> > on line 3293 in the version in stretch):
> > # uversionmanglesd version is '', make best effort to set it
> > $newfile_base =~
> > m/^.+[-_]?(\d[\-+\.:\~\da-zA-Z]*)(?:\.tar\.(gz|bz2|xz)|\.zip)$/i;
> > $newversion = $1;
> > ^^^^^^^^^^^^^^^^^^^^^^^
>
> Problem seems to be ".+" is greedy and eat "2." So this must be
> made non-greedy match.
>
> > m/^(?:.+)[-_]?(\d[\-+\.:\~\da-zA-Z]*)(?:\.tar\.(gz|bz2|xz)|\.zip)$/i;
> > $newversion = $2;
Should be non-greedy match ... not a non-capturing match .. Sigh
> > m/^.+?[-_]?(\d[\-+\.:\~\da-zA-Z]*)(?:\.tar\.(gz|bz2|xz)|\.zip)$/i;
> > $newversion = $1;
Osamu
More information about the devscripts-devel
mailing list