[wpkg-users] [gaio at sv.lnf.it: <download /> examples...]
Rainer Meier
r.meier at wpkg.org
Mon Jun 20 22:40:22 CEST 2011
Hi Marco,
On 25.01.2011 10:44, Marco Gaiarin wrote:
>
> No one answer to this questione, someone can help me?
Actually you could have a look at the XSD which documents it best.
> There's some examples of the use of the download tag? The documentation
> are really scarce, and on recipe repository seems there's no one recupe
> that use it.
You can either directly within the package defnition:
<package id='FileZilla'
name='FileZilla'
revision='3.5.0'
priority='50'
reboot='false' >
<!-- FileZilla FTP/SFTP client 3.5.0.0 -->
<check type='uninstall' condition='exists' path='FileZilla Client 3.5.0' />
<download url="http:/www...." target="%TEMP%" />
<download url="http:/www...." target="%TEMP%" />
<download url="http:/www...." target="%TEMP%" />
<install cmd='%TEMP%\installer.exe' />
<remove cmd='[path-to-uninstall]' />
<upgrade cmd='%TEMP%\installer.exe' />
</package>
This way of WPKG will of course process all download instructions each time the
package is used (install/upgrade/remove). Which is slightly inefficient
regarding the remove instructions in this case as it likely invokes only local
commands and does not need the files downloaded.
So you can also specify a download assigned to a specific command:
<package id='FileZilla'
name='FileZilla'
revision='3.5.0'
priority='50'
reboot='false' >
<!-- FileZilla FTP/SFTP client 3.5.0.0 -->
<check type='uninstall' condition='exists' path='FileZilla Client 3.5.0' />
<install cmd='%TEMP%\installer.exe'>
<download url="http:/www...." target="%TEMP%" />
<download url="http:/www...." target="%TEMP%" />
<download url="http:/www...." target="%TEMP%" />
</install>
<remove cmd='[path-to-uninstall]' />
<upgrade cmd='%TEMP%\installer.exe'>
<download url="http:/www...." target="%TEMP%" />
<download url="http:/www...." target="%TEMP%" />
<download url="http:/www...." target="%TEMP%" />
</upgrade>
</package>
I think you should have got the idea ;)
There is also an optional "timeout" attribute on the download node. It's
specified in seconds and the purpose is quite obvious.
> On detail, i'm just considering if there's a way to add the download
> tags to recipes but not actually use them, leaving the download task to
> an external script.
In this case you would simply specify commands which do the download. WPKG
executes the commands in order specified within the package XML file. So feel
free to invoke any downloader tool like wget as the first install command.
In some cases this might even be a much better solution than using the WPKG
built-in download functionality. The reason is that wget is a specialized
download tool with many options, redirection support, cookie and session support
etc while WPKG only does plain HTTP requests. Due to limitation on WSH I also do
not recommend to add much more functionality to WPKG here. In case of advanced
requirements I would rather go for the wget solution.
As you asked for a switch to globally disable WPKG downloads you might use
simple environment variables to signal to your own script whether the command
which executes wget would actually run or not.
> Ok, i can put comments on package with the same content, but define the
> downlaod tag and (globally, on per-site) not use it it is a bit cleaner
> solution, at least seems to me...
This feature request has been just processed. Will be in the next release I think.
br,
Rainer
More information about the wpkg-users
mailing list