Bug 8981 - Tar task command additional features
Summary: Tar task command additional features
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.4.1
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2002-05-10 16:40 UTC by Don Keeting
Modified: 2008-11-24 03:57 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Don Keeting 2002-05-10 16:40:57 UTC
I would like to be able to view the contents of a tar file, and have the 
contents available to use with the condition task.

Also, I would like to be able to specify the files to be tar'd from a 
delimited text file containing full paths to each file.

I believe that these requests should be valuable to other people as well.
I am not sure if viewing the contents would fall under the tar task or would be 
another task, but I will let the experts decide.

Great tool by the way!

Don Keeting
Comment 1 Steve Loughran 2002-05-10 18:10:17 UTC
1. you can use <untar> to expand the file, then things like <available> to 
look at what was expanded

2. In ant 1.5 you can load a text file into a single property using 
<propertyfile>; you can then use that as the includes= attr for tar

Comment 2 Erik Hatcher 2002-05-10 18:48:12 UTC
Correction to Steve's (2) - he meant <loadfile>.
Comment 3 Diane Holt 2002-05-10 19:19:03 UTC
Second correction to Steve's (2) -- since <tar> forms an implicit fileset, it 
won't like a list of full-path filenames in the 'includes' (same problem that 
all the implicit-fileset tasks have). And I can't tell if the the 'fullpath' 
attribute of the nested <tarfileset> attribute would take a list of filenames, 
since so far I haven't even managed to get it to work with one filename :(
Comment 4 Don Keeting 2002-05-11 16:39:27 UTC
1. Yes, I agree that this could be done, but there are situations where this is
not pratical, or efficient.  Example: Suppose you have an existing directory
structure containing many files, and you have a tar file which might contain
some of the same files and some new files.  Suppose you would like to know the
contents of the tar file.  If you untar the file, you will not be able to tell
which files came from the tar, and which files were preexisting, or both.
A nice feature would be to have the ability to do the equivilant of the tar
command: "tar -tvf tarfile.tar" or "tar -tf tarfile.tar".  I would like to be
able to make the table of contents available.

2. In version 1.4.1, if I use this:
<tar tarfile="${build.dir}/listfile.tar" basedir="${src.dir}"
includesfile="listfile.txt" />
where "listfile.txt" is contained in the basedir, and the file contains
filenames separated by newlines, it will tar all of the files from the list.
The problem is, in my case the basedir will be the root directory, so I need to
be able to include the list of fully qualified paths of files to be included in
the tar file.