[wpkg-users] Replace xmlhttp download with curl/wget

Rainer Meier r.meier at wpkg.org
Thu Jul 14 17:48:38 CEST 2011


Hi Marco,

On 14.07.2011 15:13, Marco Gaiarin wrote:
> Mandi! heiko.helmle at horiba.com
>    In chel di` si favelave...
>
>> Great idea! But this'll require another external tool, because hash calculation
>> via WSH is a world of slow.
>
> I've speaked about a script exactly for that.
>
> It is trivial in a CMD script to execute firstly curl/wget to download
> files, check exit code and if '0', run 'md5 -c' as in:
>
> 	http://www.fourmilab.ch/md5/
>
> and do and 'exit 0' if and only if both retun zero.

Is there a reason this could not be done using existing commands?
At first look this request somehow looks like someone would use the download tag 
just to launch an external program or script with some parameters. This is done 
on install/upgrade/downgrade/remove if the download tag is used. But to execute 
commands there is already a tag: <install />, <upgrade />, <remove /> and 
<downgrade />.

There is no requirement that these commands can only launch installers. In fact 
it's even the case that many packages use these commands to do preparation or 
post-install work. So simply calling a script with some parameters (e.g. 
download URL, download target, MD5-sum) the script could take care about 
downloading and checksumming the file. If anything fails it just returns an exit 
code different to 0 to indicate an error so WPKG will stop the installation.

I know that the <download /> tag is very limited but the reasons for it have 
been listed already in this discussion. But I am not sure if there is good 
reason to abuse the download tag just to invoke some external download tools 
when such a thing can be done already using existing functionality.

Well, probably I am just weary today but somebody might explain in detail why 
using existing commands is not an option or why the download tag would be much 
better to achieve this.

I agree that using a "special download command" flag would be possible too. I 
would then prefer to call a cmd script (included in wplkg distribution) with all 
required parameters like
downloader.cmd <URL> <target> <MD5>

So this script could handle download and verification as needed using any tool 
you like and any flags suitable for your environment (e.g. proxy flags).


Well, still I am not sure where the advantage over using this script as one of 
the first commands would be.

br,
Rainer



More information about the wpkg-users mailing list