You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/03/08 03:47:17 UTC

svn commit: r156484 - lenya/trunk/src/targets/webapp-build.xml

Author: gregor
Date: Mon Mar  7 18:47:17 2005
New Revision: 156484

URL: http://svn.apache.org/viewcvs?view=rev&rev=156484
Log:
Only copy cocoon.xconf if it has changed. Patch by Felix Roethenbacher. This resolves http://issues.apache.org/bugzilla/show_bug.cgi?id=33847

Modified:
    lenya/trunk/src/targets/webapp-build.xml

Modified: lenya/trunk/src/targets/webapp-build.xml
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/targets/webapp-build.xml?view=diff&r1=156483&r2=156484
==============================================================================
--- lenya/trunk/src/targets/webapp-build.xml (original)
+++ lenya/trunk/src/targets/webapp-build.xml Mon Mar  7 18:47:17 2005
@@ -58,12 +58,25 @@
 
     <!-- Patch cocoon.xconf -->
     <echo>INFO: Patch cocoon.xconf with publication-specific changes</echo>
-    <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf"
-            srcdir="${build.webapp}/lenya/pubs" 
-            includes="*/config/*.xconf"
-            excludes="*/config/publication.xconf"
-            addComments="true"/>
-            
+    <copy file="${build.webapp}/WEB-INF/cocoon.xconf"
+          toFile="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"/>
+    <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
+             srcdir="${build.webapp}/lenya/pubs" 
+             includes="*/config/*.xconf"
+             excludes="*/config/publication.xconf"
+             addComments="true"/>
+    <checksum
+        file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
+        property="cocoon.xconf.md5"/>
+    <checksum
+        file="${build.webapp}/WEB-INF/cocoon.xconf"
+        property="${cocoon.xconf.md5}"
+        verifyProperty="cocoon.xconf.isEqual"/>
+    <condition property="cocoon.xconf.copy">
+       <istrue value="${cocoon.xconf.isEqual}"/>
+    </condition>
+    <antcall target="copy-cocoon.xconf"/>
+    <antcall target="delete-cocoon.xconf.ant_patch"/>            
     <!-- Patch web.xml -->
     <!--
     <echo>INFO: Patch web.xml</echo>
@@ -150,6 +163,19 @@
       <fileset dir="legal"/>
     </copy>
 
+  </target>
+
+  <!-- Copy cocoon.xconf -->
+  <target name="copy-cocoon.xconf" if="cocoon.xconf.copy">
+    <echo>INFO: Apply new cocoon.xconf.</echo>
+    <copy
+       file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"
+       toFile="${build.webapp}/WEB-INF/cocoon.xconf"/>
+  </target>
+  <!-- ... or delete patch file -->
+  <target name="delete-cocoon.xconf.ant_patch" unless="cocoon.xconf.copy">
+    <echo>INFO: Discard patched cocoon.xconf.</echo>
+    <delete file="${build.webapp}/WEB-INF/cocoon.xconf.ant_patch"/>
   </target>
 
   <!--



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org