Tar Task

View: New views
7 Messages — Rating Filter:   Alert me  

Tar Task

by Rez P :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello Everyone,

 

How do I get the tar task to overwrite its previously created tar file? Please see my current target below.  I don't want to delete my dist folder each time and I don't see any options in the help section to overwrite the previous version of ShellScripts.tar.

 

 <target name="tar" >
  <tar destfile="${dist}/ShellScripts.tar"
   basedir="shell"
   excludes="**/cvs/**"
  />
 </target>

 

Thanks

 

Rez
     
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/

Re: Tar Task

by Francis Galiegue-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 15, 2009 at 00:48, Rez P <pons32@...> wrote:

>
> Hello Everyone,
>
>
>
> How do I get the tar task to overwrite its previously created tar file? Please see my current target below.  I don't want to delete my dist folder each time and I don't see any options in the help section to overwrite the previous version of ShellScripts.tar.
>
>
>
>  <target name="tar" >
>  <tar destfile="${dist}/ShellScripts.tar"
>   basedir="shell"
>   excludes="**/cvs/**"
>  />
>  </target>
>
>

You can just <delete> the tarball before recreating it. Delete won't
fail if it can't find the file to delete.

--

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@...
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: Tar Task

by Scot P. Floess-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


It should just over-write it for you automatically...

Here is an example of what I did:

<project>
     <tar destfile="DIST/ShellScripts.tar" basedir="shell"
excludes="**/cvs/**"/>
</project>

# echo  "hello" > shell/foo.txt
# ant
Buildfile: build.xml
       [tar] Building tar:
/home/sfloess/development/test/ant3/DIST/ShellScripts.tar
# tar tvf DIST/ShellScripts.tar
-rw-r--r-- 0/0               6 2009-10-15 13:37:50 foo.txt
# mv shell/foo.txt shell/alpha.txt
# ant
Buildfile: build.xml
       [tar] Building tar:
/home/sfloess/development/test/ant3/DIST/ShellScripts.tar

BUILD SUCCESSFUL
Total time: 1 second
# tar tvf DIST/ShellScripts.tar
-rw-r--r-- 0/0               6 2009-10-15 13:37:50 alpha.txt

Note the first run the tar file had foo.txt in it...

Second run it correctly contained alpha.txt :)


On Wed, 14 Oct 2009, Rez P wrote:

>
> Hello Everyone,
>
>
>
> How do I get the tar task to overwrite its previously created tar file? Please see my current target below.  I don't want to delete my dist folder each time and I don't see any options in the help section to overwrite the previous version of ShellScripts.tar.
>
>
>
> <target name="tar" >
>  <tar destfile="${dist}/ShellScripts.tar"
>   basedir="shell"
>   excludes="**/cvs/**"
>  />
> </target>
>
>
>
> Thanks
>
>
>
> Rez
>
> _________________________________________________________________
> Hotmail: Trusted email with powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/177141665/direct/01/

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: Tar Task

by Rez P :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Great, thanks. I was so busy thinking about deleting the folder that deleting the file didn't occur to me. Duh!  :)

 

Good to know that delete won't fail if the file doesn't exist.

 

Thanks.
 

> Date: Thu, 15 Oct 2009 08:33:56 +0200
> Subject: Re: Tar Task
> From: fge@...
> To: user@...
>
> On Thu, Oct 15, 2009 at 00:48, Rez P <pons32@...> wrote:
> >
> > Hello Everyone,
> >
> >
> >
> > How do I get the tar task to overwrite its previously created tar file? Please see my current target below.  I don't want to delete my dist folder each time and I don't see any options in the help section to overwrite the previous version of ShellScripts.tar.
> >
> >
> >
> >  <target name="tar" >
> >  <tar destfile="${dist}/ShellScripts.tar"
> >   basedir="shell"
> >   excludes="**/cvs/**"
> >  />
> >  </target>
> >
> >
>
> You can just <delete> the tarball before recreating it. Delete won't
> fail if it can't find the file to delete.
>
> --
>
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 683 877 875
> Tel : +33 (0) 178 945 552
> fge@...
> 40 avenue Raymond Poincaré
> 75116 Paris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
     
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/

RE: Tar Task

by Rez P :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks Scott

 

So I run the tar target each time regardless of whether any files have changed or not.  Is the Tar task smart enough to detect that if there were no changes, there's nothing to do? Apparently it is.

 

C:\MyCVS\src\>ant tar
Buildfile: build.xml

tar:
      [tar] Nothing to do: C:\MyCVS\src\dist\ShellScripts.tar is up to date.

 

BUILD SUCCESSFUL
Total time: 0 seconds
----------------------------

> Date: Thu, 15 Oct 2009 13:43:03 -0400
> From: sfloess@...
> To: user@...
> Subject: Re: Tar Task
>
>
> It should just over-write it for you automatically...
>
> Here is an example of what I did:
>
> <project>
> <tar destfile="DIST/ShellScripts.tar" basedir="shell"
> excludes="**/cvs/**"/>
> </project>
>
> # echo "hello" > shell/foo.txt
> # ant
> Buildfile: build.xml
> [tar] Building tar:
> /home/sfloess/development/test/ant3/DIST/ShellScripts.tar
> # tar tvf DIST/ShellScripts.tar
> -rw-r--r-- 0/0 6 2009-10-15 13:37:50 foo.txt
> # mv shell/foo.txt shell/alpha.txt
> # ant
> Buildfile: build.xml
> [tar] Building tar:
> /home/sfloess/development/test/ant3/DIST/ShellScripts.tar
>
> BUILD SUCCESSFUL
> Total time: 1 second
> # tar tvf DIST/ShellScripts.tar
> -rw-r--r-- 0/0 6 2009-10-15 13:37:50 alpha.txt
>
> Note the first run the tar file had foo.txt in it...
>
> Second run it correctly contained alpha.txt :)
>
>
> On Wed, 14 Oct 2009, Rez P wrote:
>
> >
> > Hello Everyone,
> >
> >
> >
> > How do I get the tar task to overwrite its previously created tar file? Please see my current target below. I don't want to delete my dist folder each time and I don't see any options in the help section to overwrite the previous version of ShellScripts.tar.
> >
> >
> >
> > <target name="tar" >
> > <tar destfile="${dist}/ShellScripts.tar"
> > basedir="shell"
> > excludes="**/cvs/**"
> > />
> > </target>
> >
> >
> >
> > Thanks
> >
> >
> >
> > Rez
> >
> > _________________________________________________________________
> > Hotmail: Trusted email with powerful SPAM protection.
> > http://clk.atdmt.com/GBL/go/177141665/direct/01/
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC 27549
>
> 252-478-8087 (Home)
> 919-890-8117 (Work)
>
> Chief Architect JPlate http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>
> Architect Keros http://sourceforge.net/projects/keros
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
     
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/

RE: Tar Task

by Scot P. Floess-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I believe it is smart enough :)

On Thu, 15 Oct 2009, Rez P wrote:

>
> Thanks Scott
>
>
>
> So I run the tar target each time regardless of whether any files have changed or not.  Is the Tar task smart enough to detect that if there were no changes, there's nothing to do? Apparently it is.
>
>
>
> C:\MyCVS\src\>ant tar
> Buildfile: build.xml
>
> tar:
>      [tar] Nothing to do: C:\MyCVS\src\dist\ShellScripts.tar is up to date.
>
>
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
> ----------------------------
>> Date: Thu, 15 Oct 2009 13:43:03 -0400
>> From: sfloess@...
>> To: user@...
>> Subject: Re: Tar Task
>>
>>
>> It should just over-write it for you automatically...
>>
>> Here is an example of what I did:
>>
>> <project>
>> <tar destfile="DIST/ShellScripts.tar" basedir="shell"
>> excludes="**/cvs/**"/>
>> </project>
>>
>> # echo "hello" > shell/foo.txt
>> # ant
>> Buildfile: build.xml
>> [tar] Building tar:
>> /home/sfloess/development/test/ant3/DIST/ShellScripts.tar
>> # tar tvf DIST/ShellScripts.tar
>> -rw-r--r-- 0/0 6 2009-10-15 13:37:50 foo.txt
>> # mv shell/foo.txt shell/alpha.txt
>> # ant
>> Buildfile: build.xml
>> [tar] Building tar:
>> /home/sfloess/development/test/ant3/DIST/ShellScripts.tar
>>
>> BUILD SUCCESSFUL
>> Total time: 1 second
>> # tar tvf DIST/ShellScripts.tar
>> -rw-r--r-- 0/0 6 2009-10-15 13:37:50 alpha.txt
>>
>> Note the first run the tar file had foo.txt in it...
>>
>> Second run it correctly contained alpha.txt :)
>>
>>
>> On Wed, 14 Oct 2009, Rez P wrote:
>>
>>>
>>> Hello Everyone,
>>>
>>>
>>>
>>> How do I get the tar task to overwrite its previously created tar file? Please see my current target below. I don't want to delete my dist folder each time and I don't see any options in the help section to overwrite the previous version of ShellScripts.tar.
>>>
>>>
>>>
>>> <target name="tar" >
>>> <tar destfile="${dist}/ShellScripts.tar"
>>> basedir="shell"
>>> excludes="**/cvs/**"
>>> />
>>> </target>
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> Rez
>>>
>>> _________________________________________________________________
>>> Hotmail: Trusted email with powerful SPAM protection.
>>> http://clk.atdmt.com/GBL/go/177141665/direct/01/
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC 27549
>>
>> 252-478-8087 (Home)
>> 919-890-8117 (Work)
>>
>> Chief Architect JPlate http://sourceforge.net/projects/jplate
>> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>>
>> Architect Keros http://sourceforge.net/projects/keros
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@...
>> For additional commands, e-mail: user-help@...
>>
>
> _________________________________________________________________
> Hotmail: Trusted email with powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/177141665/direct/01/

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: Tar Task

by Stefan Bodewig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-10-15, Rez P <pons32@...> wrote:

> How do I get the tar task to overwrite its previously created tar
> file? Please see my current target below.  I don't want to delete my
> dist folder each time and I don't see any options in the help section
> to overwrite the previous version of ShellScripts.tar.

The core tar task doesn't support this scenario, so you'd have to delete
the archive before re-creating it.

OTOH the tar task will re-create your target archive if any of the files
that would end up inside the archive are newer than the entries inside
the existing archive.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...