From: Rafael Garcia-Suarez Date: Fri, 25 May 2007 09:57:33 +0000 (+0000) Subject: Upgrade to Archive::Tar 1.32. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=97a504ba76c612b4a75b812be186d7ed5f1593ef;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Archive::Tar 1.32. p4raw-id: //depot/perl@31274 --- diff --git a/lib/Archive/Tar.pm b/lib/Archive/Tar.pm index ddfd970..fe0d0f8 100644 --- a/lib/Archive/Tar.pm +++ b/lib/Archive/Tar.pm @@ -14,7 +14,7 @@ use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD $DEBUG = 0; $WARN = 1; $FOLLOW_SYMLINK = 0; -$VERSION = "1.31"; +$VERSION = "1.32"; $CHOWN = 1; $CHMOD = 1; $DO_NOT_USE_PREFIX = 0; diff --git a/lib/Archive/Tar/Constant.pm b/lib/Archive/Tar/Constant.pm index 3112d59..8cd56a4 100644 --- a/lib/Archive/Tar/Constant.pm +++ b/lib/Archive/Tar/Constant.pm @@ -43,8 +43,8 @@ use constant MODE_READ => sub { $_[0] =~ /^r/ ? 1 : 0 }; # Pointless assignment to make -w shut up my $getpwuid; $getpwuid = 'unknown' unless eval { my $f = getpwuid (0); }; my $getgrgid; $getgrgid = 'unknown' unless eval { my $f = getgrgid (0); }; -use constant UNAME => sub { $getpwuid || scalar getpwuid( shift() ) }; -use constant GNAME => sub { $getgrgid || scalar getgrgid( shift() ) }; +use constant UNAME => sub { $getpwuid || scalar getpwuid( shift() ) || '' }; +use constant GNAME => sub { $getgrgid || scalar getgrgid( shift() ) || '' }; use constant UID => $>; use constant GID => (split ' ', $) )[0]; diff --git a/lib/Archive/Tar/File.pm b/lib/Archive/Tar/File.pm index 0af91f3..fe5480d 100644 --- a/lib/Archive/Tar/File.pm +++ b/lib/Archive/Tar/File.pm @@ -237,14 +237,26 @@ sub _new_from_file { my $type = __PACKAGE__->_filetype($path); my $data = ''; - unless ($type == DIR || $type == SYMLINK) { - my $fh = IO::File->new; - $fh->open($path) or return; - - ### binmode needed to read files properly on win32 ### - binmode $fh; - $data = do { local $/; <$fh> }; - close $fh; + READ: { + unless ($type == DIR ) { + my $fh = IO::File->new; + + unless( $fh->open($path) ) { + ### dangling symlinks are fine, stop reading but continue + ### creating the object + last READ if $type == SYMLINK; + + ### otherwise, return from this function -- + ### anything that's *not* a symlink should be + ### resolvable + return; + } + + ### binmode needed to read files properly on win32 ### + binmode $fh; + $data = do { local $/; <$fh> }; + close $fh; + } } my @items = qw[mode uid gid size mtime]; diff --git a/lib/Archive/Tar/t/src/long/bar.tar.packed b/lib/Archive/Tar/t/src/long/bar.tar.packed index 2ac21e4..7a4a2d4 100644 --- a/lib/Archive/Tar/t/src/long/bar.tar.packed +++ b/lib/Archive/Tar/t/src/long/bar.tar.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/long/bar.tar lib/Archive/Tar/t/src/long/bar.tar.packed -Created at Fri May 18 13:05:16 2007 +Created at Thu May 24 15:38:19 2007 ######################################################################### __UU__ M8P`````````````````````````````````````````````````````````` diff --git a/lib/Archive/Tar/t/src/long/foo.tgz.packed b/lib/Archive/Tar/t/src/long/foo.tgz.packed index 67cc3ac..f9464f7 100644 --- a/lib/Archive/Tar/t/src/long/foo.tgz.packed +++ b/lib/Archive/Tar/t/src/long/foo.tgz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/long/foo.tgz lib/Archive/Tar/t/src/long/foo.tgz.packed -Created at Fri May 18 13:05:16 2007 +Created at Thu May 24 15:38:19 2007 ######################################################################### __UU__ M'XL(`````````^W72VZ#,!`&8*]S"BY`F,$/MCT`ET")25`