ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Z W" <mpc8...@gmail.com>
Subject equals condition issue
Date Wed, 06 Feb 2008 12:10:20 GMT
Hi

monitor.sh is a shell script on a remote host that returns a 1 or other
non-zero number
I'm having problems trying to get property "confused" to be checked and used
within the if-then-else condition.
But for unknown reason, it refuses to enter into the then section of script
even though the property is matched to 1.
Am willing to hear feedback/tips from the gurus here.
Any help/tips is appreciated.


Output
-----------
_check:
  [sshexec] Connecting to lin2:22
  [sshexec] 1                         <-------------- returned by monitor.sh
     [echo] return_code 1
     [echo] end of target
_recheck:
     [echo]  confused 1
     [echo]
BUILD SUCCESSFUL
Total time: 1 second





Below is my partial script.



<target name="_check">

<sshexec host="${host}}"

username="${name}"

password="${pass}"

command=". ./.profile;

cd ${lg_dir};

./monitor.sh ;

"

failonerror="false"

output="output.txt"

outputproperty="return_code"

timeout="0"

trust="true"/>

<echo message="return_code ${return_code}" />

<echo message="end of target" />

<ac:propertycopy name="confused" from="return_code"/>

<antcall target="_recheck"/>

</target>



<target name="_recheck">

<echo> confused ${confused} </echo>

<ac:if>

<equals arg1="${confused}" arg2="1" />

<ac:then>

<echo> Inside </echo>

<ac:var name="return_code" unset="true"/>

<ac:var name="confused" unset="true"/>

<ac:antcallback

antfile="main.xml"

target="complete">

</ac:antcallback>

</ac:then>

<ac:else>

<ac:antcallback
  antfile="_start.xml"             <---------- suppose to call the top
target; unknown reason why it refuses to execute even not 1
  target="_check"
  return="return_code">
 </ac:antcallback -->

</ac:else>

</ac:if>

</target>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message