[wpkg-users] [Bug 262] Wrong variable apply order

bugzilla-daemon at bugzilla.wpkg.org bugzilla-daemon at bugzilla.wpkg.org
Fri Jan 13 16:31:10 CET 2012


http://bugzilla.wpkg.org/show_bug.cgi?id=262

--- Comment #6 from Stefan Pendl <pendl2megabit at yahoo.de>  ---
Rainer,

I have used variable overriding before the extended host matching and advanced
property checks have been included.
I am currently in the process to consolidate profiles and use check conditions
to determine, if a package should be applied or not, especially for those which
apply to more than one group of hosts.

Since I have a structured environment and my host groups are mostly recognized
by the host names, it is easy to move the whole variable assignment to the
package level.

In other environments it is easier to override variables in the order: read
package -> read profile -> read host -> apply.

Since it seems to be easy to implement both ways how about the following
change:

//---code start (watch for line wraps)

function loadPackageEnv(packageNode) {

    // Array to store all variables found.
    var variables =  new Array();

    // Host variables first...
    if (gReverseVariableReadOrder == true) {
        variables = getPackageVariables(packageNode, variables);
    } else {
        variables = getHostsVariables(variables);
    }

    // ...then profile variables...
    variables = getProfileVariables(variables);

    // ...and lastly package variables.
    if (gReverseVariableReadOrder == true) {
        variables = getHostsVariables(variables);
    } else {
        variables = getPackageVariables(packageNode, variables);
    }

    // Apply variables to environment.

//---code end

This way one can choose which read order to use.

What do you think?

--
Stefan

-- 
Configure bugmail: http://bugzilla.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the wpkg-users mailing list