title: ant tar task: procedure for enabling "tar append"
body: <p>Goal: use ant to create a single tar archive for any combination
  of (say) 5 folders (all folders, or any 3 folders or any 4 folders
  ...). I prefer not using temp dirs and the copy command.</p>
  
  <p>This should be simple if the ant tar task supports append.</p>
  
  <p>A search lead me to:</p>
  
  <blockquote>
    <p>Setting mode="update" in the compress antlib's tar task should do what is requested.</p>
  </blockquote>
  
  <p>from: <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=39617" rel="nofollow">https://issues.apache.org/bugzilla/show_bug.cgi?id=39617</a></p>
  
  <p>How do I know if 'antlib' is installed, or how do I install
  it. How does one set mode="update" - which file is chgd?.</p>
  
  <p>What is the best way to enable "tar append" in ant's tar task?</p>
  
  <p>GNU tar -r or -u options fail unless the tar file already exists -
  any ideas on how to deal w/that in ant?</p>
  
  <pre><code>--
  </code></pre>
  
  <p>thanks</p>
  
  <p>PS</p>
  
  <p>The below example is a work around that forks a shell, then checks to
  see if the tarfile exists, and runs tar w/append option if it does:</p>
  
  <pre><code>&lt;target name="package-blah" description="generate tar file" depends="clean,init"&gt;
    &lt;exec executable="sh" &gt;
        &lt;arg value="-xc"/&gt;
        &lt;arg value="
          [[ -f ${tarfile} ]] &amp;amp;&amp;amp; C=r || C=c;
          tar ${C}vf ${tarfile} --exclude '*/.svn' ${src}/main/blah
        "/&gt;
    &lt;/exec&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>I would prefer not to use the above approach, but it works.</p>