[wpkg-users] Using package variable in tests
Rainer Meier
r.meier at wpkg.org
Sat Apr 26 13:00:03 CEST 2008
Hi Daniel,
I just read through the report and would like to share some comments.
Daniel Dehennin wrote:
> Tying to install mozilla firefox with WPKG, it seems to me that
> variables defined in packages are not expanded when doing tests.
This is currently by design - package variables are only expanded during
package commands (install/upgrade/downgrade/remove).
It would require some re-design to make package variables available to
check nodes as well as for check nodes the package context is not
available. However I am thinking about a flexible way to do it.
I will try to make this enhancement available to WPKG 1.1.
> <variable name='MozDir' value='%ProgramFiles%\Mozilla Firefox'/>
>
> <!-- Le fichier all.js inclu bien mozilla.cfg -->
> <check type='file' condition='exists' path='%MozDir%\greprefs\all.js'/>
> <check type='execute'
> path='"%WPKGBIN%\qgrep.exe" -B -L "pref(\"general.config.filename\", \"mozilla.cfg\");" "%MozDir%\greprefs\all.js"'/>
>
> <install cmd='%ComSpec% /c echo pref("general.config.filename", "mozilla.cfg"); >> "%MozDir%\greprefs\all.js"'/>
>
> <remove cmd='%WPKGBIN%\gsar.exe -o -s"pref(\"general.config.filename\", \"mozilla.cfg\");" -r "%MozDir%\greprefs\all.js"'/>
>
> In the debug log I got:
> ====
>
> The path '"%MozDir%\greprefs\all.js"' does not exist: the test failed
> [...]
> Reading variables from package
> Reading variables from package Firefox Configuration
> Got variable 'MozDir' of value '%ProgramFiles%\Mozilla Firefox'
> Stored 1 variables from package
> [...]
As you can see the checks are executed outside the package context
currently.
I will try to enhance the packages in a way that variables are available
for all package operations.
br,
Rainer
More information about the wpkg-users
mailing list