You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by se...@apache.org on 2009/06/22 02:14:46 UTC

svn commit: r787117 - in /httpcomponents/httpcore/trunk: pom.xml src/main/assembly/build.xml

Author: sebb
Date: Mon Jun 22 00:14:45 2009
New Revision: 787117

URL: http://svn.apache.org/viewvc?rev=787117&view=rev
Log:
Fix zip or tgz archives depending on host OS EOL setting

Modified:
    httpcomponents/httpcore/trunk/pom.xml
    httpcomponents/httpcore/trunk/src/main/assembly/build.xml

Modified: httpcomponents/httpcore/trunk/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/pom.xml?rev=787117&r1=787116&r2=787117&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/pom.xml (original)
+++ httpcomponents/httpcore/trunk/pom.xml Mon Jun 22 00:14:45 2009
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- 
-   $HeadURL$
    $Revision$
-   $Date$
 
    ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one
@@ -151,15 +149,15 @@
           <tasks>
             <ant antfile="src/main/assembly/build.xml">
               <property name="target" value="${project.build.directory}" />
-              <property name="package.zip" value="${pom.artifactId}-${pom.version}-bin.zip" />
+              <property name="package.name" value="${pom.artifactId}-${pom.version}-bin" />
             </ant>
             <ant antfile="src/main/assembly/build.xml">
               <property name="target" value="${project.build.directory}" />
-              <property name="package.zip" value="${pom.artifactId}-${pom.version}-src.zip" />
+              <property name="package.name" value="${pom.artifactId}-${pom.version}-src" />
             </ant>
             <ant antfile="src/main/assembly/build.xml">
               <property name="target" value="${project.build.directory}" />
-              <property name="package.zip" value="${pom.artifactId}-${pom.version}-osgi-bin.zip" />
+              <property name="package.name" value="${pom.artifactId}-${pom.version}-osgi-bin" />
             </ant>
           </tasks>
         </configuration>

Modified: httpcomponents/httpcore/trunk/src/main/assembly/build.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/src/main/assembly/build.xml?rev=787117&r1=787116&r2=787117&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/src/main/assembly/build.xml (original)
+++ httpcomponents/httpcore/trunk/src/main/assembly/build.xml Mon Jun 22 00:14:45 2009
@@ -1,7 +1,5 @@
 <!-- 
-   $HeadURL$
    $Revision$
-   $Date$
 
    ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one
@@ -27,15 +25,44 @@
    information on the Apache Software Foundation, please see
    <http://www.apache.org/>.
  -->
-<project name="assembly-postprocess" default="fixzip" basedir=".">
-  <target name="fixzip">
+<project name="assembly-postprocess" default="fixarchives" basedir=".">
+
+  <target name="fixarchives" depends="_eolcheck,fixzip,fixtgz">
+  </target>
+
+  <target name="fixzip" unless="native.crlf">
     <property name="tmp.dir" location="${target}/tmp"/>    
-    <property name="zip.file" location="${target}/${package.zip}"/>    
+    <property name="zip.file" location="${target}/${package.name}.zip"/>    
     <delete dir="${tmp.dir}" />
     <unzip src="${zip.file}" dest="${tmp.dir}"/>
-    <fixcrlf srcdir="${tmp.dir}" eol="dos" eof="remove"
+    <fixcrlf srcdir="${tmp.dir}" eol="crlf" eof="remove" fixlast="false"
         includes="**/*.txt, **/*.xml, **/*.properties, **/*.java, **/*.html, **/*.css" />
     <zip destfile="${zip.file}" basedir="${tmp.dir}" duplicate="preserve" />
     <delete dir="${tmp.dir}" />
   </target>  
+
+  <target name="fixtgz" unless="native.lf">
+    <property name="tmp.dir" location="${target}/tmp"/>    
+    <property name="gz.file" location="${target}/${package.name}.tar.gz"/>    
+    <property name="tar.file" location="${target}/${package.name}.tar"/>    
+    <delete dir="${tmp.dir}" />
+    <gunzip src="${gz.file}" dest="${tar.file}"/>
+    <untar src="${tar.file}" dest="${tmp.dir}"/>
+    <fixcrlf srcdir="${tmp.dir}" eol="lf" eof="remove" fixlast="false"
+        includes="**/*.txt, **/*.xml, **/*.properties, **/*.java, **/*.html, **/*.css" />
+    <tar destfile="${tar.file}" basedir="${tmp.dir}" longfile="gnu"/>
+    <gzip src="${tar.file}" destfile="${gz.file}"/>
+  	<delete file="${tar.file}"/>
+    <delete dir="${tmp.dir}"/>
+  </target>  
+
+  <!-- Determine if the native format is CRLF or LF (or neither) -->
+  <target name="_eolcheck">
+    <condition property="native.lf">
+        <os family="unix"/>
+    </condition>
+    <condition property="native.crlf">
+        <os family="dos"/>
+    </condition>
+  </target>
 </project>