On Sat, 2009-02-14 at 17:53 -0200, Martín Ferrari wrote: > Hi, today I spotted a watchfile being reported as invalid on PET, while > uscan processed it fine. I think this behaviour is incompatible with > what is documented (and PET watchfile processor is based mostly on the > documentation), and I also think that the documented behaviour is saner. [...] > opts=uversionmangle="s/^\d\.\d$/$&00/;s/^\d\.\d\d0$/$&0" \ > http://search.cpan.org/dist/Term-Size/ \ > ..*/Term-Size-v?(\d[\d_.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)
Out of interest, where did that package come from? The version of libterm-size-perl in the archive (0.2-4) doesn't appear to contain any mangling options in its watch file. > As you can see, the quotes were intended to be put before > 'uversionmangle', and PET follows the documentation: the code is split > by semicolons and then executed. So it tries and fails to execute this > code: > > "s/^\d\.\d$/$&00/; On Sat, 2009-02-14 at 18:01 -0200, Martín Ferrari wrote: > More joy, I've just discovered that the second regex is completely > invalid, and I don't understand what was uscan doing: > > opts=uversionmangle="s/^\d\.\d$/$&00/;s/^\d\.\d\d0$/$&0" > > If you look closely, the last slash is missing! uscan *is* following the documented behaviour, it's just not checking for errors when applying the mangling. A quick bit of debug printing added to the code shows that the regex is being split by semicolons in to the two portions you'd expect - "s/^\d\.\d$/$&00/ and s/^\d\.\d\d0 $/$&0". The two portions are then being passed through Perl's eval() in order to apply the mangling to the version string. However, there's no check as to whether the eval threw errors or not. I'm not sure whether they're being intentionally or accidentally ignored as yet, but they are being ignored. In the case of the sample watch file you provided, afaics neither of the mangle options affects the version number (currently 0.207), so the package is successfully downloaded anyway. I've been through the lintian lab on gluck and that contains only one packages that has syntax broken in the way you describe, which I'll file a bug about. uscan does, however, apply the mangling as documented for that package - i.e. the mangling the maintainer intended to apply fails due to the eval() failing. Regards, Adam -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org