Subject: | Dangling symlinks not preserved |
When add_files() is called on a dangling symlink Archive::Tar reports an error and ignores the
symlink. The normal tar command will add dangling symlinks without any complaints. Patch to
correct this problem is attached.
Subject: | Archive-Tar_symlink.patch |
diff -Nur Archive-Tar-1.30.orig/lib/Archive/Tar/File.pm Archive-Tar-1.30/lib/Archive/Tar/File.pm
--- Archive-Tar-1.30.orig/lib/Archive/Tar/File.pm 2006-03-03 07:40:57.000000000 -0600
+++ Archive-Tar-1.30/lib/Archive/Tar/File.pm 2007-04-19 11:30:24.000000000 -0500
@@ -237,7 +237,7 @@
my $type = __PACKAGE__->_filetype($path);
my $data = '';
- unless ($type == DIR) {
+ unless ($type == DIR || $type == SYMLINK) {
my $fh = IO::File->new;
$fh->open($path) or return;
diff -Nur Archive-Tar-1.30.orig/lib/Archive/Tar.pm Archive-Tar-1.30/lib/Archive/Tar.pm
--- Archive-Tar-1.30.orig/lib/Archive/Tar.pm 2006-08-01 14:57:43.000000000 -0500
+++ Archive-Tar-1.30/lib/Archive/Tar.pm 2007-04-19 11:31:49.000000000 -0500
@@ -1116,7 +1116,7 @@
my @rv;
for my $file ( @files ) {
- unless( -e $file ) {
+ unless( -e $file || -l $file ) {
$self->_error( qq[No such file: '$file'] );
next;
}