From a261de08b428969ea74660fbadb2ca2420551e5d Mon Sep 17 00:00:00 2001 From: Jan Materne Date: Tue, 18 Dec 2007 08:41:04 +0000 Subject: [PATCH] examples: - tar: tarfile is deprecated since 1.5 - gzip: zipfile is not deprecated, but use of common name - fix attribute names (Bug 44082) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@605137 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/tar.html | 38 +++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/docs/manual/CoreTasks/tar.html b/docs/manual/CoreTasks/tar.html index d9e9d66c4..e61fb8097 100644 --- a/docs/manual/CoreTasks/tar.html +++ b/docs/manual/CoreTasks/tar.html @@ -69,6 +69,11 @@ or "bzip2".

Description Required + + destfile + the tar-file to create. + Yes + destfile the tar-file to create. @@ -156,15 +161,16 @@ supported as a nested element.

Examples

-<tar tarfile="${dist}/manual.tar" basedir="htdocs/manual"/>
-<gzip zipfile="${dist}/manual.tar.gz" src="${dist}/manual.tar"/>
+<tar destfile="${dist}/manual.tar" basedir="htdocs/manual"/> +<gzip destfile="${dist}/manual.tar.gz" src="${dist}/manual.tar"/>

tars all files in the htdocs/manual directory into a file called manual.tar in the ${dist} directory, then applies the gzip task to compress it.

+
 <tar destfile="${dist}/manual.tar"
-      basedir="htdocs/manual"
-      excludes="mydocs/**, **/todo.html"
+     basedir="htdocs/manual"
+     excludes="mydocs/**, **/todo.html"
 />

tars all files in the htdocs/manual directory into a file called manual.tar in the ${dist} directory. Files in the directory mydocs, @@ -183,7 +189,6 @@ or files with the name todo.html are excluded.

<include name="*.html"/> </tarfileset> </tar> -

Writes the file docs/readme.txt as /usr/doc/ant/README into the archive. All @@ -193,10 +198,9 @@ or files with the name todo.html are excluded.

/usr/doc/ant/index.html to the archive.

-
 <tar longfile="gnu"
-     destfile="${dist.base}/${dist.name}-src.tar" >
+     destfile="${dist.base}/${dist.name}-src.tar">
   <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
     <include name="${dist.name}/bootstrap.sh"/>
     <include name="${dist.name}/build.sh"/>
@@ -208,7 +212,6 @@ or files with the name todo.html are excluded.

</tarfileset> </tar>
-

This example shows building a tar which uses the GNU extensions for long paths and where some files need to be marked as executable (mode 755) and the rest are use the default mode (read-write by owner). The first @@ -228,23 +231,24 @@ attribute as with all other filesets. In the example above, of a directory, so ${dist.name} is a valid path relative to ${dist.name}/...

+
-<tar dest="release.tar.gz" compress="gzip">
+<tar destfile="release.tar.gz" compression="gzip">
   <zipfileset src="release.zip"/>
 </tar>
 
-

Re-packages a ZIP archive as a GZip compressed tar archive. If Unix file permissions have been stored as part of the ZIP file, they will be retained in the resulting tar archive.

-

Note: - Please note the tar task creates a tar file, it does not append - to an existing tar file. The existing tar file is replaced instead. - As with most tasks in Ant, the task only takes action if the output - file (the tar file in this case) is older than the input files, or - if the output file does not exist. -

+ +

Note: + Please note the tar task creates a tar file, it does not append + to an existing tar file. The existing tar file is replaced instead. + As with most tasks in Ant, the task only takes action if the output + file (the tar file in this case) is older than the input files, or + if the output file does not exist. +