Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with tarballs with entry with "./" in front #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miyagawa
Copy link

use Carp::Always;
use Dist::Metadata;

$m = Dist::Metadata->new(file => shift);
warn (($m->dist->find_files)[0]);
$m->dist->file_content(($m->dist->perl_files)[0]);
> perl metadata.pl ~/minicpan/authors/id/A/AL/ALTITUDE/MsqlCGI-0.8.tar.gz
./MsqlCGI-0.8/MsqlCGI-bin/CreateDef.pl at -e line 1.
No such file in archive: 'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm' at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3/Archive/Tar.pm line 1581.
        Archive::Tar::_error('Archive::Tar=HASH(0x7fc00c04f090)', 'No such file in archive: \'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm\'') called at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3/Archive/Tar.pm line 1038
        Archive::Tar::_find_entry('Archive::Tar=HASH(0x7fc00c04f090)', 'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm') called at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3/Archive/Tar.pm line 1074
        Archive::Tar::get_content('Archive::Tar=HASH(0x7fc00c04f090)', 'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm') called at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/Dist/Metadata/Tar.pm line 30
        Dist::Metadata::Tar::file_content('Dist::Metadata::Tar=HASH(0x7fc00c174f78)', 'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm') called at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3/Archive/Tar.pm line 1581.
        Archive::Tar::_error('Archive::Tar=HASH(0x7fc00c04f090)', 'No such file in archive: \'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm\'') called at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3/Archive/Tar.pm line 1038
        Archive::Tar::_find_entry('Archive::Tar=HASH(0x7fc00c04f090)', 'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm') called at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3/Archive/Tar.pm line 1074
        Archive::Tar::get_content('Archive::Tar=HASH(0x7fc00c04f090)', 'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm') called at /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/Dist/Metadata/Tar.pm line 30
        Dist::Metadata::Tar::file_content('Dist::Metadata::Tar=HASH(0x7fc00c174f78)', 'MsqlCGI-0.8/MsqlCGI-bin/MsqlCGI.pm') called at -e line 1

This is probably because Dist::Metadata normalizes the path in the tar entry and eliminates the leading ./.

@miyagawa
Copy link
Author

i added a workaround to match when entries have ./, in Tar listing code. This should probably be better handled in Dist base class but there's a lot of File::Spec and Path::Class normalization going on, which I would rather avoid changing.

@miyagawa
Copy link
Author

Similar issue with id/G/GL/GLOVER/Curses-Devkit-4.9.3.tar.gz

@xsawyerx
Copy link
Contributor

Ping?

@rwstauner
Copy link
Owner

Oops!
Ugh. Not only did i leave this without comment for (exactly) 2 years, but it's missing a file that the test requires. Any chance that's still available? Probably not too hard to recreate...
Though this might be a good argument for doing #9 (and letting the extraction handle the edge case).

@miyagawa
Copy link
Author

it's A/AL/ALTITUDE/MsqlCGI-0.8.tar.gz available on backpan i believe.

@miyagawa
Copy link
Author

@rwstauner
Copy link
Owner

rwstauner commented Apr 22, 2015 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants