You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2007/11/14 13:05:45 UTC
svn commit: r594847 -
/harmony/enhanced/buildtest/branches/2.0/scripts/svn.xml
Author: smishura
Date: Wed Nov 14 04:05:36 2007
New Revision: 594847
URL: http://svn.apache.org/viewvc?rev=594847&view=rev
Log:
Add conditions for check out
Modified:
harmony/enhanced/buildtest/branches/2.0/scripts/svn.xml
Modified: harmony/enhanced/buildtest/branches/2.0/scripts/svn.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/svn.xml?rev=594847&r1=594846&r2=594847&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/svn.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/svn.xml Wed Nov 14 04:05:36 2007
@@ -113,15 +113,28 @@
<!-- -->
<target name="-init">
- <!--TODO: detect if the dir indeed required svn url -->
- <condition property="need.to.checkout">
- <not>
- <available file="${checkouts.dir}/${libname}" />
- </not>
+ <property name="dir.to.checkout" value="${checkouts.dir}/${libname}" />
+
+ <!-- get dir url -->
+ <exec executable="svn" dir="${checkouts.dir}">
+ <arg line="info ${libname}" />
+ <redirector outputproperty="dir.url" errorproperty="dev.null">
+ <outputfilterchain>
+ <linecontains>
+ <contains value="URL: " />
+ </linecontains>
+ <tokenfilter>
+ <replacestring from="URL: " to="" />
+ </tokenfilter>
+ </outputfilterchain>
+ </redirector>
+ </exec>
+ <condition property="is.under.svn">
+ <length string="${dir.url}" trim="true" when="greater" length="0" />
</condition>
<!--TODO: detect infra root -->
- <condition property="url"
+ <condition property="svn.url"
value="http://svn.apache.org/repos/asf/harmony/enhanced/buildtest/branches/2.0/${lib.url}"
else="${lib.url}">
<!--FIXME: need regexp -->
@@ -129,14 +142,43 @@
<contains string="${lib.url}" substring="http" />
</not>
</condition>
+
+ <fail message="Existing dir it is not under SVN: ${dir.to.checkout}">
+ <condition>
+ <and>
+ <available file="${dir.to.checkout}" />
+ <not>
+ <isset property="is.under.svn" />
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <fail message="SVN urls conflict. Expected: ${svn.url}, actual: ${dir.url}">
+ <condition>
+ <and>
+ <available file="${dir.to.checkout}" />
+ <isset property="is.under.svn" />
+ <not>
+ <equals arg1="${svn.url}" arg2="${dir.url}" />
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <condition property="need.to.checkout">
+ <not>
+ <available file="${dir.to.checkout}" />
+ </not>
+ </condition>
</target>
<target name="-checkout-if-necessary" if="need.to.checkout" depends="-init">
- <mkdir dir="${checkouts.dir}/${libname}" />
+ <mkdir dir="${dir.to.checkout}" />
<exec executable="svn" failonerror="true">
- <arg line="co ${url} ${checkouts.dir}/${libname}" />
+ <arg line="co ${svn.url} ${dir.to.checkout}" />
</exec>
</target>
</project>