common/templates/source-spec.ant.xml.ftl
changeset 898 79766bc6c419
parent 897 53bb02c83036
child 909 869f7b50a6f1
equal deleted inserted replaced
897:53bb02c83036 898:79766bc6c419
    35                 <available file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" type="dir"/>
    35                 <available file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" type="dir"/>
    36             </and>
    36             </and>
    37             <then>
    37             <then>
    38                 <!-- Package in cache already -->
    38                 <!-- Package in cache already -->
    39                 <echo message="Pull from ${pkg_detail.source} to ${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
    39                 <echo message="Pull from ${pkg_detail.source} to ${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
    40                 <exec executable="hg" dir="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" failonerror="true">
    40                 <exec executable="hg" dir="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" failonerror="false" resultproperty="sf.spec.sourcesync.cache.pull.error.code.${count}">
    41                     <arg value="pull"/>
    41                     <arg value="pull"/>
    42                     <arg value="${pkg_detail.source}"/>
    42                     <arg value="${pkg_detail.source}"/>
    43                 </exec>
    43                 </exec>
    44                 <echo message="Clone from ${dollar}{sf.spec.sourcesync.cachelocation.${count}} to ${ant['build.drive']}${pkg_detail.dst}"/>
    44                 <if>
    45                 <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
    45                     <equals arg1="0" arg2="${dollar}{sf.spec.sourcesync.cache.pull.error.code.${count}}"/>
    46                     <arg value="clone"/>
    46                     <then>
    47                     <arg value="-U"/>
    47                         <echo message="Clone from ${dollar}{sf.spec.sourcesync.cachelocation.${count}} to ${ant['build.drive']}${pkg_detail.dst}"/>
    48                     <arg value="--uncompressed"/>
    48                         <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
    49                     <arg value="${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
    49                             <arg value="clone"/>
    50                     <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
    50                             <arg value="-U"/>
    51                 </exec>
    51                             <arg value="--uncompressed"/>
       
    52                             <arg value="${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
       
    53                             <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
       
    54                         </exec>
       
    55                     </then>
       
    56                     <else>
       
    57                         <!-- Uh oh - the cache is corrupted somehow -->
       
    58                         <!-- (Try to) recover the cache repo -->
       
    59                         <forget>
       
    60                             <exec executable="hg" dir="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" failonerror="false" resultproperty="sf.spec.sourcesync.cache.recover.error.code.${count}">
       
    61                                 <arg value="recover"/>
       
    62                             </exec>
       
    63                             <if>
       
    64                                 <not><equals arg1="0" arg2="${dollar}{sf.spec.sourcesync.cache.recover.error.code.${count}}"/></not>
       
    65                                 <then>
       
    66                                     <echo message="Trashing ${dollar}{sf.spec.sourcesync.cachelocation.${count}} as broken"/>
       
    67                                     <delete dir="${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
       
    68                                 </then>
       
    69                             </if>
       
    70                         </forget>
       
    71                         <!-- In the meantime, by-pass it for this build -->
       
    72                         <echo message="Clone from ${pkg_detail.source} to ${ant['build.drive']}${pkg_detail.dst}"/>
       
    73                         <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
       
    74                             <arg value="clone"/>
       
    75                             <arg value="-U"/>
       
    76                             <arg value="${pkg_detail.source}"/>
       
    77                             <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
       
    78                         </exec>
       
    79                     </else>
       
    80                 </if>
    52                 <!-- Update to required revision -->
    81                 <!-- Update to required revision -->
    53                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
    82                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
    54                     <arg value="update"/>
    83                     <arg value="update"/>
    55                     <arg value="-r"/>
    84                     <arg value="-r"/>
    56                     <arg value="${pkg_detail.pattern}"/>
    85                     <arg value="${pkg_detail.pattern}"/>