Skip Menu |

This queue is for tickets about the Archive-Tar CPAN distribution.

Report information
The Basics
Id: 4974
Status: resolved
Priority: 0/
Queue: Archive-Tar

People
Owner: Nobody in particular
Requestors: chris [...] clotho.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.08
Fixed in: (no value)



Subject: contains_file fails to see files in subdirs in gnutar files
The following test case shows that contains_file() fails unexpectedly for files in a subdirectory. The failure is the "no" in the "perl test.pl" output below. It seems to me that contains_file should simply use _find_entry like the other methods. % tar --version tar (GNU tar) 1.13.25 % perl -v This is perl, v5.8.1 built for darwin % mkdir Subdir % echo "test" > Subdir/file % echo "test" > otherfile % tar -cf test.tar Subdir otherfile % perl test.pl Archive: Subdir/, Subdir/file, otherfile Contains Subdir/file: no Content Subdir/file: yes Contains otherfile: yes Content otherfile: yes ----------------- test.pl ----------------- use Archive::Tar; $Archive::Tar::WARN = 0; my $tar = Archive::Tar->new("test.tar") || die; print "Archive: ". join(", ", $tar->list_files())."\n"; foreach ("Subdir/file", "otherfile") { print "Contains $_: ".($tar->contains_file($_) ? "yes" : "no")."\n"; print "Content $_: ".($tar->get_content($_) ? "yes" : "no")."\n"; } -------------------------------------------
Thanks, it's fixed @9752 and will be in the next release kudos to the excellent test case you provided