[wpkg-users] Variables in settings.xml

Rainer Meier r.meier at wpkg.org
Mon Apr 14 23:08:32 CEST 2008


Hi Falko

Falko Trojahn wrote:
>> In my settings.xml I want to define some variables, like this:
>>
>>   <script-variable name="WPKG">\\server\wpkg</script-variable>
>>   <script-variable name="WPKGBIN">%WPKG%\bin</script-variable>
>>   <script-variable name="WPKGLOG">%WPKG%\log</script-variable>
>>   <script-variable name="SOFTWARE">\\horus\partage\applis\install</script-variable>
>>   <script-variable name="PATH">%WPKGBIN%;%PATH%</script-variable>
>>
>> But it seems that WPKGLOG is not well expanded, in my debug output I
>> have:
>>
>> 2008-04-14 16:28:52, DEBUG   : Initializing new log file: %WPKG%\log\wpkg-teststation.log
>> 2008-04-14 16:28:52, DEBUG   : Failed to open log file: Chemin d'accès introuvable; falling back to local logging: null
>>
>> Regards.
> 
> I don't think that variables are expanded in log file.
> But perhaps you could create an enhancement request on
> bugzilla.wpkg.org

This is correct. And it would introduce lots of overhead to expand 
variables there as well. Variables can be package specific an do not 
exist when the log function is called. So I see no reason to change it. 
If you like to debug the environment just create a "dummy package" which 
is dumping all environment variables to a file.


In addition the way Daniel wants to define global variables is not 
supported by WPKG 1.0 (did 0.9.x support such a thing?). In fact WPKG 
just allows you to overwrite any _internal_ variable of WPKG through the 
config file by a <param name='varname' value='value' /> entry. There is 
currently no way to specify global environment variables. In fact this 
is not necessary since WPKG is either run by WPKG client service (which 
allows you to set variables prior to wpkg.js invocation. Or you can run 
WPKG by any *.cmd script which can define variables before invoking 
wpkg.js. No need for WPKG to define global variables by itself.

However it supports to specify package-specific and package specific 
variables as follows:

<variable name="var" value="val" />

NOTE: This needs to be a sub-node of either <profile /> or <package />. 
You could use the XSD files checked in recently to verify your XML files.


> For logging you should use in config.xml:
> 
> <param name='log_file_path' value='\\\\server\\share\\dir' />
> and
> <param name='logfilePattern' value='wpkg-[HOSTNAME].log' />

Absolutely correct.


> In my logs I see "%SOFTWARE%", too - not expanded.

This is intended behavior. There are no plans to change it. The logs 
should output the commands as entered by the user to the package 
definition. This allows easy look-up within the XML files.

br,
Rainer



More information about the wpkg-users mailing list