Subject: | ->extract_path and ->files are unreliable |
After an extraction, ->extract_path sometimes does some magical things.
If I extract( to => 'foo' ), then ->extract_path will be either 'foo' or 'foo/bar' depending on the archive type.
Furthermore, the relationship between ->extract_path and ->files is not consistent.
Sometimes you can just add an entry from->files onto ->extract_path, and sometimes you can't.
The problem is caused by
Archive::Extract::_untar_at(/usr/local/share/perl/5.8.4/Archive/Extract.pm:548):
548: my $test = File::Spec->rel2abs( $files[0] );
DB<3>
Archive::Extract::_untar_at(/usr/local/share/perl/5.8.4/Archive/Extract.pm:549):
549: my $dir = -d $test ? $test : dirname($test);
This seems to want to "have it's cake and eat it too".
It first sets the extract_path magically to a subdirectory, if the first element in the tarball is a subdirectory, but having changed it's mind about where the base is, doesn't update the file list to strip the leading directory.
Now, I'm happy either way (magic or non-magic) but you need to make the results more consistent.
I'm ending up with ->extract_path being '...../Class-Foo-1.23' and the files list being [ 'Class-Foo.123/', ... ].
Sometimes they match, sometimes they don't. Sometimes extract_path returns the 'to' dir, sometimes a magic subdir...
Please fix one. Either remove the subdir magic or update the files list.
Thanks