[wpkg-users] Nested packages and variables

Rainer Meier r.meier at wpkg.org
Tue Sep 11 13:02:14 CEST 2012


Hi Steve,

On 11.09.2012 12:37, Steve Kersley wrote:
> Is it possible to set a variable in the parent ‘stub’ package that can then be
> accessed in the child packages?
>
> My testing suggests not.  Setting JAVA_VERSION in the parent package isn’t
> accessible from the child packages - unless I’m doing something wrong?

You are right.
Previous versions of WPKG did not care too much about scope of variables. This 
leads to issues where variables might have different content depending on the 
order they are applied. Moreover a some packages might check whether a variable 
is defined or not and then depending on order of applying packages the variable 
might be "accidentally" defined by another package or not.

So the decision was made to make sure package variables are defined within the 
scope of the package only. If you need to define variables for all packages then 
you can use host or profile variables.

Moreover it should technically be possible to define variables in commands using 
"setx" which will then be visible to all commands executed later on (but not to 
WPKG itself as the cscript/WPKG environment is already defined when WPKG is 
launched.

Honestly I currently see more potential issues than benefit from fetching 
variables from the whole dependency tree on package execution. Due to complex 
include/dependency trees it would be quite difficult to fetch all variables in 
right order and moreover to determine what will be the final variable name by 
package maintainer.

br,
Rainer



More information about the wpkg-users mailing list