[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Strange problem with uscan



On Mon, Dec 28, 2020 at 08:34:21PM +0100, Mechtilde wrote:
> Am 27.12.20 um 22:41 schrieb Matija Nalis:
> > On Sat, Dec 26, 2020 at 09:50:39AM +0100, Mechtilde Stehmann wrote:
> >> sometimes uscan is unable to download upstream sources and failed:
> >> This happens only when I have name and version number like
> >> jackson-core-2.12.0
> > 
> > Hmm, it looks to me like it would fail always?
> > 
> >> What is wrong here?
> >> This is my watch file:
> >>
> >> version=4
> >> opts=\
> >> uversionmangle=s/-alpha/~alpha/;s/-Beta/~beta/;s/-rc/~rc/;s/PRE/~pre/,\
> >> filenamemangle=s/.+\/v?(\d\S+)\.*/$1/ \
> >> https://github.com/FasterXML/jackson-core/releases .*jackson-core-
> >> v?(\d\S+)\.tar\.gz
> > 
> > There seems to be bug in your "filenamemangle" regex.
> > 
> > And if that "filenamemangle" doesn't match, uscan(1) documentation
> > says the uscan will take alternate route, which is probably not what you want. 
> > So you must make sure this regex always matches and produces wanted filename.
> > 
> > 
> > You can test your filenamemangle with:
> > echo '$URLPART' | perl -pe '$REGEX'
> > 
> > eg.
> > 
> > % echo '/FasterXML/jackson-core/archive/jackson-core-2.12.0.tar.gz' | perl -pe 's/.+\/v?(\d\S+)\.*/$1/'
> > /FasterXML/jackson-core/archive/jackson-core-2.12.0.tar.gz
> > 
> > which returns wrong result -- you want it to return JUST filename without any path
> > components (ie. just "jackson-core-2.12.0.tar.gz" in this case)
> > 
> > Note that "\.*" is especially wrong in your regex, as it means 
> > "0 or more of LITERAL dot (".") characters, like "" or "." or ".......", 
> > but nothing else. If you wanted to match 0 or more of ANY characters
> > (as I guess was intention), it would be just ".*" (without "\").
> > 
> > For latest file released this looks like working regex:
> > echo    /FasterXML/jackson-core/archive/jackson-core-2.12.0.tar.gz | perl -pe 's/.+\/(jackson-core-\d\S+).*/$1/'
> > jackson-core-2.12.0.tar.gz
> > 
> > So you can start with that and improve.  Just make sure it always
> > matches all your possible URLs and produces (just a) correct
> > filename.
> > 
> > Hope this helps,

It did, lines like
> > echo '$URLPART' | perl -pe '$REGEX'
> > 
> > 
> > % echo '/FasterXML/jackson-core/archive/jackson-core-2.12.0.tar.gz' | perl -pe 's/.+\/v?(\d\S+)\.*/$1/'
> > /FasterXML/jackson-core/archive/jackson-core-2.12.0.tar.gz
did help ernomous


> > Matija
> > 
> Hello,

Hello 
all of you how are catching up after some days off-line.
(Yes, make it possible to read in the discussion order,
reply below previous text)


 
> I could identify one reason, why I ran in that problem.
> 
> The name of the upstream source is doubled in the name of the downloaded
> file.
> 
> the packages in question are:
> 
> https://github.com/zxing/zxing
> https://github.com/FasterXML/jackson-core
> 
> So I think I need a special part in the debian/watch file in these cases

I think the standard approach in `man scan` on `github` does work fine.


> Kind regards
> Mechtilde


Regards
Geert Stappers
-- 
Silence is hard to parse


Reply to: