[wpkg-users] wpkg.js: function loadPackageEnv

Bernhard Mayr bmmayr at gmail.com
Sat Jul 18 10:57:45 CEST 2020


Dear wpkg community,

This is my first post here, so please apologize for any stupidities.
I was trying to define variables in profiles, but they were not expanded
when the packages were processed (when looking in the windows event logs),
which should work since wpkg 1.3.x (
https://wpkg.org/Variables#WPKG_1.3.x_and_above) right?

I had a look at wpkg.js (var WPKG_VERSION = "1.3.1";) and found the
following code in the function loadPackageEnv

// Load package variables and define them in the environemnt.
// This allows them to be used within profile and host definition.
var packageVariables = getPackageVariables(packageNode, null);
setEnvironmentList(packageVariables);

// Now load the profile environment which can use package variables and is
// allowed to override package variables.
var profileVariables = getProfileVariables(null);
setEnvironmentList(profileVariables);

// Now load the host environment which can use package and profile
// variables and is allowed to override those.
var hostsVariables = getHostsVariables(null);
setEnvironmentList(hostsVariables);

to me this looked like pre-1.3.x behaviour and I changed the order from
package-profile-host  to  host-profile-package

// First load the host environment which can NOT use package and profile
// variables and is NOT allowed to override those.
var hostsVariables = getHostsVariables(null);
setEnvironmentList(hostsVariables);

// Then load the profile environment which can NOT use package variables
and is
// NOT allowed to override package variables.
var profileVariables = getProfileVariables(null);
setEnvironmentList(profileVariables);

// Last load package variables and define them in the environemnt.
// This allows them to use profile and host variables.
var packageVariables = getPackageVariables(packageNode, null);
setEnvironmentList(packageVariables);

for me this seemed to have fixed my issues.

Now I'm just wondering if I'm too stupid to understand how the guts of wpkg
are supposed to work or if I'm up to something.

Best regards

Bernhard Mayr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20200718/3c71d91d/attachment.html>


More information about the wpkg-users mailing list