Bug 15244 - tar task should be able to store symbolic links as links
Summary: tar task should be able to store symbolic links as links
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.5.1
Hardware: Sun Solaris
: P3 enhancement with 2 votes (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-10 17:27 UTC by Martin
Modified: 2008-11-24 03:57 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2002-12-10 17:27:42 UTC
If followsymlinks is true, symbolic links are followed and the referenced 
material will be stored in the tar file.

Apparently if followsymlinks is false, symbolic links are not followed and 
NOTHING will be stored for them in the tar file.

I would prefer that in this case symbolic links should be stored as relative or 
absolute pointers in the tar file. In my opinion this is the standard behaviour 
of GNU tar.
Comment 1 Gus Heck 2002-12-10 21:02:22 UTC
Though not strictly a duplicate, this bug is almost exactly the same issue as 
but 14320 

Reading bug 1550 will also shed light on why this is quite a difficult problem
to address. 

The symlink task provides a means by which to record links in an abosolute form,
but this probably won't meet your needs unless you are untaring the tarballs
with ant and can use the symlink task to recreate the links.

Relative links are unfortunately impossible to percieve due to the limmitations
of Java. I did find a fairly cool way to get relative links on linux though by
recording and unpacking the links in a temp file that always resides in the
exact same location in the filesystem. When you do this, you can exec "symlinks
-rcs" in the top level directory twice before recording and twice after
expansion to get identical relative links (mixed relative and aboslute would
require creative use of apply and symlinks).

If I find some time I hope to add this tip/trick in more explicit/clearer form
to the docs for symlinks. Unfortunately, it is horribly platform/os specific
though :(. I don't think all unicies have a symlinks command.
Comment 2 Gus Heck 2002-12-10 21:03:23 UTC
oops I typoed! I meant to refer you to bug 14320 

*blush*