ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Charters <mchar...@fiore.physics.lsa.umich.edu>
Subject ant <tar> and <jar> tasks do not preserve file permissions?
Date Fri, 20 Sep 2002 16:51:11 GMT
hi,

i just created a save task to compress the entire dir into a dated jar 
file ... so that before i make major changes in my program i have a 
backup.

unfortunately, the ant jar task does not preserve the permissions on the 
files when it saves (i am running linux and have scripts for doing 
things in my project ... and it does not save the executable 
permission in the jar file)...

i decided to try the tar task instead ... and that produces the same 
problem -- the permissions are not saved

anyone know how to get jar or tar to preserve the permissions?  or does 
anyone have a better way for me to do what i am doing (just making a 
backup of my entire build dir)

here are the targets that i created:

  <target name="save"
          depends="getDate, getTime"
          description="create a save jar in ${saveDir}/${currentLS}-${today}-${timenow}.jar">
    <jar jarfile="${saveDir}/${currentLS}-${today}-${timenow}.jar"
         basedir="."
         excludes="${saveDir}/${currentLS}-${today}-${timenow}.jar"/>
    <echo message="The jarfile is in ${saveDir}/${currentLS}-${today}-${timenow}.jar"/>
  </target>

  <target name="savetar"
          depends="getDate, getTime"
          description="create a save tar in ${saveDir}/${currentLS}-${today}-${timenow}.tar">
    <tar tarfile="${saveDir}/${currentLS}-${today}-${timenow}.tar"
         basedir=".">
      <exclude name="${saveDir}/**"/>
      <exclude name="${classDir}/**"/>
    </tar>
    <gzip src="${saveDir}/${currentLS}-${today}-${timenow}.tar" zipfile="${saveDir}/${currentLS}-${today}-${timenow}.tar.gz"/>
    <delete file="${saveDir}/${currentLS}-${today}-${timenow}.tar"/>
    <echo message="The tarfile is in ${saveDir}/${currentLS}-${today}-${timenow}.tar"/>
  </target>

any help would be appreciated.

thanks,
-Mike


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message