Bugs item #3023387, was opened at 2010-06-30 14:42
Message generated for change (Tracker Item Submitted) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=3023387&group_id=31650

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Functions
Group: 0.90
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: https://me.yahoo.com/a/N1XAFoxk ()
Assigned to: Nobody/Anonymous (nobody)
Summary: variable with if statement not working inside setenv

Initial Comment:
 I have the following setenv block:

<setenv verbose="true" failonerror="false">
   <variable name="test" 
value="${environment::get-variable('some_non_existing_envvar')}" 
if="${environment::variable-exists('some_non_existing_envvar')}" />
 </setenv>

The environment variable does not exist, but I get a fatal error as the value 
is still attempted to be set.

Function call failed.
Expression: ${environment::get-variable('some_non_existing_envvar')}
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Environment variable "some_non_existing_envvar" does not exist.

If I move the "if" statement up to the setenv level, the variable is not set 
which is what I expect.
The workaround I am using is this:

<if test="${environment::variable-exists('some_non_existing_envvar')}" >
          <setenv verbose="true" name="test" 
value="${environment::get-variable('some_non_existing_envvar')}">
   </if>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=3023387&group_id=31650

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to