Subject: | extract_archive() returns true even in cases of error |
First a disclaimer: this could be the same issue as https://rt.cpan.org/Ticket/Display.html?id=61398 --- I did not check if extract() and extract_archive() are implemented in the same way.
A oneliner to reproduce the problem (tested on Debian/jessie and FreeBSD 9.2 with various perl versions):
cd /tmp && wget -Otest.tar.gz https://cpan.metacpan.org/authors/id/B/BI/BINGOS/Archive-Tar-2.18.tar.gz && truncate -s 60000 test.tar.gz && perl -MTest::More=no_plan -MArchive::Tar -e 'ok(!Archive::Tar->extract_archive("test.tar.gz"))'
Output is:
...
Read error on tarfile (missing data) 'Archive-Tar-2.18/lib/Archive/Tar/File.pm' at offset unknown at -e line 1.
not ok 1
...
So contrary to documentation no false value was returned. This seems to happen only if at least one file was extracted.