ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 1607] New - Ant 'tar' task broken
Date Thu, 03 May 2001 00:40:50 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1607

*** shadow/1607	Wed May  2 17:40:50 2001
--- shadow/1607.tmp.13662	Wed May  2 17:40:50 2001
***************
*** 0 ****
--- 1,124 ----
+ +============================================================================+
+ | Ant 'tar' task broken                                                      |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1607                        Product: Ant                     |
+ |       Status: NEW                         Version: Nightly build           |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version: Linux                   |
+ |     Priority: Medium                    Component: Core tasks              |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: jeff@socialchange.net.au                                     |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Some time between the release of 1.3 and current (5/3/2001) CVS, the 'tar' task
+ has changed behaviour. Let's say I want to tar up a 'src' directory:
+ 
+ src/
+ src/a.txt
+ src/b.txt
+ 
+ with the following Ant build file:
+ 
+ <?xml version="1.0"?>
+ <project name="tartest" default="main" basedir=".">
+   <target name="main" description="Tar a directory">
+     <tar tarfile="foo.tar" basedir="src"/>
+   </target>
+ </project>
+ 
+ Here's what happens:
+ [jeff@kermit tartest]$
+ /home/jeff/apache/jakarta/jakarta-ant/jakarta-ant-1.4alpha/bin/ant -version
+ Ant version 1.4alpha compiled on May 3 2001
+ [jeff@kermit tartest]$
+ /home/jeff/apache/jakarta/jakarta-ant/jakarta-ant-1.4alpha/bin/ant
+ Buildfile: build.xml
+ 
+ main:
+       [tar] Building tar: /home/jeff/tmp/ant/tartest/foo.tar
+ 
+ BUILD SUCCESSFUL
+ 
+ Total time: 0 seconds
+ [jeff@kermit tartest]$ 
+ [jeff@kermit tartest]$ tar tvf foo.tar 
+ -rw-r--r-- 0/0               0 2001-05-03 11:18:19 
+ -rw-r--r-- 0/0              16 2001-05-03 11:12:06 a.txt
+ -rw-r--r-- 0/0              16 2001-05-03 11:12:15 b.txt
+ 
+ [jeff@kermit tartest]$ tar xvf foo.tar 
+ 
+ tar: : Cannot open: No such file or directory
+ a.txt
+ b.txt
+ tar: Error exit delayed from previous errors
+ 
+ 
+ Whereas, If I do the same thing with Ant 1.3, it works:
+ [jeff@kermit tartest]$ ant -version
+ Ant version 1.3 compiled on March 2 2001
+ [jeff@kermit tartest]$ ant
+ Buildfile: build.xml
+ 
+ main:
+       [tar] Building tar: /home/jeff/tmp/ant/tartest/foo.tar
+ 
+ BUILD SUCCESSFUL
+ 
+ Total time: 0 seconds
+ [jeff@kermit tartest]$ tar xvf foo.tar  
+ a.txt
+ b.txt
+ 
+ 
+ (Actually, this is not the expected behaviour, as the command 'tar cvf foo.tar
+ src/' would include the src/ dir in the tar, but anyway).
+ 
+ 
+ A workaround is to explicitly list the directory to include and it's contents:
+ 
+ [jeff@kermit tartest]$ cat build2.xml 
+ <?xml version="1.0"?>
+ <project name="tartest" default="main" basedir=".">
+ 	<property name="src" value="src"/>
+ 	<target name="main" description="Tar a directory">
+ 		<tar tarfile="foo.tar" basedir="." includes="${src}/**"/>
+ 	</target>
+ </project>
+ [jeff@kermit tartest]$
+ /home/jeff/apache/jakarta/jakarta-ant/jakarta-ant-1.4alpha/bin/ant -buildfile
+ build2.xml 
+ Buildfile: build2.xml
+ 
+ main:
+       [tar] Building tar: /home/jeff/tmp/ant/tartest/foo.tar
+ 
+ BUILD SUCCESSFUL
+ [jeff@kermit tartest]$
+ /home/jeff/apache/jakarta/jakarta-ant/jakarta-ant-1.4alpha/bin/ant -buildfile
+ build2.xml 
+ Buildfile: build2.xml
+ 
+ main:
+       [tar] Building tar: /home/jeff/tmp/ant/tartest/foo.tar
+ 
+ BUILD SUCCESSFUL
+ 
+ Total time: 0 seconds
+ 
+ [jeff@kermit tartest]$ tar xvf foo.tar  
+ src/
+ src/a.txt
+ src/b.txt
+ 
+ 
+ This may be related to bug 414
+ (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=414)
+ 
+ Thanks to those hardworking folks on ant-dev :)
+ 
+ --Jeff

Mime
View raw message