Subject: | Bug in creating tarballs when using Archive::Tar |
I had a problem with the tar balls created with Module::Build and
tracked it down to the $Archive::Tar::DO_NOT_USE_PREFIX.
In 'Module::Build::Base::make_tarball' you have the following code:
if ($self->{args}{tar}) {
my $tar_flags = $self->verbose ? 'cvf' : 'cf';
$self->do_system($self->split_like_shell($self->{args}{tar}),
$tar_flags, "$file.tar", $dir);
$self->do_system($self->split_like_shell($self->{args}
{gzip}), "$file.tar") if $self->{args}{gzip};
} else {
require Archive::Tar;
# Archive::Tar versions >= 1.09 use the following to enable a
compatibility
# hack so that the resulting archive is compatible with older
clients.
$Archive::Tar::DO_NOT_USE_PREFIX = 0; # **THIS SHOULD BE 1**
my $files = $self->rscan_dir($dir);
Archive::Tar->create_archive("$file.tar.gz", 1, @$files);
}
The code comment states that you are setting DO_NOT_USE_PREFIX to
enable compatibility with older clients, but to enable compatibility
you must set DO_NOT_USE_PREFIX to 1, as stated in the Archive::Tar
documentation. The default value for DO_NOT_USE_PREFIX is 0, which
means that Module::Build creates tar balls that ARE NOT COMPATIBLE with
older tar clients AND WinZip. In WinZip, no paths are seen for any of
the files, and so the distribution cannot be installed.
Here is a link I found on this, and how I tracked this down to a
problem with Archive::Tar.
http://www.perlmonks.org/?node_id=627736
Scott