You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Yves Willems <yw...@maia-scientific.com> on 2006/03/29 14:13:22 UTC

tar with tarfileset

Hi all,

 

I want to make a tar file holding just 3 files, but prefixed with a certain
directory name.

I created the following target:

 

<target name="make.tar">

        <tar tarfile="my.tar" basedir="${basedir}">

            <tarfileset dir="${basedir}" prefix="/anyprefix">

                <include name="lfile1"/>

                <include name="file2"/>

                <include name="file3"/>

            </tarfileset>

        </tar>

</target>

 

However when I run this thing it adds recursively ALL files under the
basedir directory to my tar file.

What am I doing wrong?

 

(I'm running 1.6.5)

 

Yves


Re: tar with tarfileset

Posted by glenn opdycke-hansen <gl...@gmail.com>.
I would remove the basedir from the tar statement, since the tarfileset
should select the files you want:

       <tar tarfile="my.tar" >
           <tarfileset dir="${basedir}" prefix="/anyprefix">
               <include name="lfile1"/>
               <include name="file2"/>
               <include name="file3"/>
           </tarfileset>
       </tar>


On 3/29/06, Yves Willems <yw...@maia-scientific.com> wrote:
>
> Hi all,
>
>
>
> I want to make a tar file holding just 3 files, but prefixed with a
> certain
> directory name.
>
> I created the following target:
>
>
>
> <target name="make.tar">
>
>         <tar tarfile="my.tar" basedir="${basedir}">
>
>             <tarfileset dir="${basedir}" prefix="/anyprefix">
>
>                 <include name="lfile1"/>
>
>                 <include name="file2"/>
>
>                 <include name="file3"/>
>
>             </tarfileset>
>
>         </tar>
>
> </target>
>
>
>
> However when I run this thing it adds recursively ALL files under the
> basedir directory to my tar file.
>
> What am I doing wrong?
>
>
>
> (I'm running 1.6.5)
>
>
>
> Yves
>
>
>