Skip Menu |
 

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

Report information
The Basics
Id: 43278
Status: resolved
Priority: 0/
Queue: Archive-Extract

People
Owner: Nobody in particular
Requestors: bdfoy [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.28
  • 0.30
  • 0.31_01
Fixed in: (no value)



Subject: Explicitly tell Archive::Zip where to put the files
Download (untitled) / with headers
text/plain 1.4k
From d4f97631f89d6f2c5d50b343a5f64d43770efdaf Mon Sep 17 00:00:00 2001 From: brian d foy <brian.d.foy@gmail.com> Date: Fri, 13 Feb 2009 20:22:35 -0600 Subject: [PATCH] * Tell Archive::Zip's extractMember where to put it. This was an odd case to track down, and I haven't come up with a small test case to demonstrate it. In my BackPAN indexing, Archive::Zip was extracting things in my script's directory instead of the current working directory. I traced this back through Archive::Zip::_asLocalName which eventually calls File::Spec::Win32::rel2abs which on Windows might call Cwd::getdcwd. getdcwd returns the wrong directory in my case, even though I think I'm on the same drive. To fix this, I pass the optional second argument to extractMember using the cwd from Archive::Extract. --- lib/Archive/Extract.pm | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/Archive/Extract.pm b/lib/Archive/Extract.pm index 7c5df63..69e023c 100644 --- a/lib/Archive/Extract.pm +++ b/lib/Archive/Extract.pm @@ -1031,7 +1031,8 @@ sub _unzip_az { for my $member ($zip->members) { push @files, $member->{fileName}; - unless( $zip->extractMember($member) == &Archive::Zip::AZ_OK ) { + unless( $zip->extractMember($member, + File::Spec->catfile(cwd(), $files[-1]) ) == &Archive::Zip::AZ_OK ) { return $self->_error(loc("Extraction of '%1' from '%2' failed", $member->{fileName}, $self->archive )); } -- 1.6.0.4
Subject: Explicitly tell Archive::Zip where to put the files
Download (untitled) / with headers
text/plain 1.4k
From d4f97631f89d6f2c5d50b343a5f64d43770efdaf Mon Sep 17 00:00:00 2001 From: brian d foy <brian.d.foy@gmail.com> Date: Fri, 13 Feb 2009 20:22:35 -0600 Subject: [PATCH] * Tell Archive::Zip's extractMember where to put it. This was an odd case to track down, and I haven't come up with a small test case to demonstrate it. In my BackPAN indexing, Archive::Zip was extracting things in my script's directory instead of the current working directory. I traced this back through Archive::Zip::_asLocalName which eventually calls File::Spec::Win32::rel2abs which on Windows might call Cwd::getdcwd. getdcwd returns the wrong directory in my case, even though I think I'm on the same drive. To fix this, I pass the optional second argument to extractMember using the cwd from Archive::Extract. --- lib/Archive/Extract.pm | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/Archive/Extract.pm b/lib/Archive/Extract.pm index 7c5df63..69e023c 100644 --- a/lib/Archive/Extract.pm +++ b/lib/Archive/Extract.pm @@ -1031,7 +1031,8 @@ sub _unzip_az { for my $member ($zip->members) { push @files, $member->{fileName}; - unless( $zip->extractMember($member) == &Archive::Zip::AZ_OK ) { + unless( $zip->extractMember($member, + File::Spec->catfile(cwd(), $files[-1]) ) == &Archive::Zip::AZ_OK ) { return $self->_error(loc("Extraction of '%1' from '%2' failed", $member->{fileName}, $self->archive )); } -- 1.6.0.4
Thanks, applied with some small modifications. -- Jos


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.