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

bugzilla-daemon at bugzilla.wpkg.org bugzilla-daemon at bugzilla.wpkg.org
Thu Jan 26 22:05:38 CET 2012


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

Rainer Meier <r.meier at wpkg.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #16 from Rainer Meier <r.meier at wpkg.org>  ---
Hi all,

I have implemented a change which reverts to variable expansion prior to WPKG
1.3. It's available on SVN:

<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/src/main/resources/wpkg/>

I've quickly tested it and it works fine. It also solves the problem that
conditions on profile/host level were not able to access variables on package
level during variable evaluation.

Moreover it allows now to check for empty/undefined variables by using
empty-string regular expression as we discussed in this thread.

Change notes:

MOD: Reverted variable evaluation order to pre WPKG-1.3 behavior. Now profile
     variables are allowed to override package variables and host variables
     are allowed to override profile variables.
     So the order of variable evaluation is as follows:
     - Package variables (lowest priority)
     - Profile variables
     - Host variables    (highest priority)
     This allows you to specify variables on hosts or profile level which do
     override variables at package level.
     Fixes bug 262. Thanks to Kalyniak Oleksandr for report and discussion.
NEW: WPKG now allows to use environment variables of lower priority
     stage in higher priority stage conditional statements.
     For example you can use a condition on a variable defined on package level
     within the profile or host definition.
     Fixes bug 262. Thanks to Kalyniak Oleksandr for report and discussion.
NEW: WPKG does not immediately abort conditional comparison if environment host
     environment variable condition is used on a variable which is undefined.
     This allows conditions to check for empty variables as well.
     This feature can be used to define conditional variables at host or
     profile level which will check for empty variable. For example:

     <variable name="MY_VAR" value="true">
       <condition>
         <check type="host" condition="environment" value="MY_VAR=^$"
       </condition>
     </variable>

     The example only defines MY_VAR if it has not been defined already. If
     such a declaration is used in hosts or profile definition it allows to
     define a variable only if it's not defined on package level already.
     Fixes bug 262. Thanks to Kalyniak Oleksandr for report and discussion.


Feedback welcome of course.

br,
Rainer

-- 
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