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

Re: watch file help needed: Download page of mkgmap changed and is now hiding download files behind JavaScript code



On 24/04/14 12:32, Andreas Tille wrote:
> Hi Daniel,
> 
> thanks for your continuous trials to help me. :-)
> 

No problem! I enjoy a good bit of problem solving!

> On Thu, Apr 24, 2014 at 11:22:22AM +0100, Daniel Lintott wrote:
>>
>> Hope that helps...
> 
> Not really since I can not confirm that I get anything else but:
> 
>    no matching hrefs for watch line
> 
> I guess we somehow need to go with Paul's hint.  All your hints are
> based on changing the regexp for the source download by droping the
> '-src' part from the file name.  Since we really want to fetch the
> source and not simply the binary jar this is not helpful.  However,
> I somehow need to make some sense out of Paul's hint which I did
> not fully understand admittedly.
> 

What Paul was hinting at was using using the downloadurlmangle as per my
first email.

What happens here is we get the href for the binary download and then
mangle it to get the source tarball, by replacing .zip with -src.tar.gz

> s/\.zip/-src.tar.gz/

Next we have to make uscan save the file it downloads with the correct
filename... filenamemangle.

> filenamemangle=s/\/download\/mkgmap-r([\d]+)\.zip/mkgmap-r$1-src.tar.gz/

Here we replace /download/mkgmap-r0000.zip with mkgmap-r0000-src.tar.gz
to match the name of the that is actually downloaded.

I have also attached a copy of the watch file I used to test the mangles.

Regards,
-- 
Daniel Lintott
GPG Key: 4096R/5D73EC6E
version=3
opts="dversionmangle=s/0.0.0.svn//,downloadurlmangle=s/\.zip/-src.tar.gz/,filenamemangle=s/\/download\/mkgmap-r([\d]+)\.zip/mkgmap-r$1-src.tar.gz/" \
http://www.mkgmap.org.uk/download/mkgmap-r([\d]+).zip

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: