Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the App-cpanminus CPAN distribution.

Report information
The Basics
Id: 56326
Status: resolved
Priority: 0/
Queue: App-cpanminus

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

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Archive::Zip check occurs too soon
Firstly, thanks! cpanminus is great. It's useful for cpanminus to be able to install many modules with a single command. We use something like "cpanm $(cat modules.txt)" to install/update many modules. The Test::Warn distro uses a .zip file so needs Archive::Zip installed. Sadly, adding Archive::Zip to modules.txt doesn't work because cpanm has already decided that's it's not available so won't use it, even though it's been installed by the time it's needed. Changing this chunk: } elsif (eval { require Archive::Zip }) { $self->chat("You have Archive::Zip $Archive::Zip::VERSION\n"); $self->{_backends}{unzip} = sub { my($self, $file) = @_; my $zip = Archive::Zip->new(); ... }; } else { $self->{_backends}{unzip} = sub { die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n"; }; } to something like this: } else { $self->{_backends}{unzip} = sub { eval { require Archive::Zip } or die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n"; my($self, $file) = @_; my $zip = Archive::Zip->new(); ... }; } would fix it.
Subject: Re: [rt.cpan.org #56326] Archive::Zip check occurs too soon
Date: Tue, 6 Apr 2010 13:17:06 -0700
To: bug-App-cpanminus [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
Hmm, i would rather like to mark it "won't fix" since you can install cpanm Archive::Zip first and then install via < modules.txt, right? I've been actually thinking of --bootstrap option, to make sure everything you need is already there i.e sane versions of EUMM, M::B and LWP/wget/curl, and i think checking if you have Archive::Zip/Tar or unzip/tar binary would be a good check to go into that command. On Tue, Apr 6, 2010 at 9:53 AM, Tim_Bunce via RT <bug-App-cpanminus@rt.cpan.org> wrote: Show quoted text
> Tue Apr 06 12:53:42 2010: Request 56326 was acted upon. > Transaction: Ticket created by TIMB >       Queue: App-cpanminus >     Subject: Archive::Zip check occurs too soon >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: TIMB@cpan.org >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=56326 > > > > Firstly, thanks! cpanminus is great. > > It's useful for cpanminus to be able to install many modules with a single command. We use something like "cpanm $(cat modules.txt)" to > install/update many modules. > > The Test::Warn distro uses a .zip file so needs Archive::Zip installed. Sadly, adding Archive::Zip to modules.txt doesn't work because cpanm has > already decided that's it's not available so won't use it, even though it's been installed by the time it's needed. > > Changing this chunk: > >      } elsif (eval { require Archive::Zip }) { >          $self->chat("You have Archive::Zip $Archive::Zip::VERSION\n"); >          $self->{_backends}{unzip} = sub { >              my($self, $file) = @_; >              my $zip = Archive::Zip->new(); >              ... >          }; >      } else { >          $self->{_backends}{unzip} = sub { >              die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n"; >          }; >      } > > to something like this: > >      } else { >          $self->{_backends}{unzip} = sub { >              eval { require Archive::Zip } >                  or die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n"; >              my($self, $file) = @_; >              my $zip = Archive::Zip->new(); >              ... >          }; >      } > > would fix it. >
-- Tatsuhiko Miyagawa
CC: TIMB [...] cpan.org
Subject: Re: [rt.cpan.org #56326] Archive::Zip check occurs too soon
Date: Tue, 6 Apr 2010 22:07:18 +0100
To: "miyagawa [...] gmail.com via RT" <bug-App-cpanminus [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Tue, Apr 06, 2010 at 04:18:20PM -0400, miyagawa@gmail.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=56326 > > > Hmm, i would rather like to mark it "won't fix" since you can install > cpanm Archive::Zip first and then install via < modules.txt, right?
True, but that complicates an otherwise simple one-step process and is redundant on systems that have unzip or Archive::Zip already installed. Show quoted text
> I've been actually thinking of --bootstrap option, to make sure > everything you need is already there i.e sane versions of EUMM, M::B > and LWP/wget/curl, and i think checking if you have Archive::Zip/Tar > or unzip/tar binary would be a good check to go into that command.
Sure. But why not also make the simple change I outlined? Tim. Show quoted text
> On Tue, Apr 6, 2010 at 9:53 AM, Tim_Bunce via RT > <bug-App-cpanminus@rt.cpan.org> wrote:
> > Tue Apr 06 12:53:42 2010: Request 56326 was acted upon. > > Transaction: Ticket created by TIMB > >       Queue: App-cpanminus > >     Subject: Archive::Zip check occurs too soon > >   Broken in: (no value) > >    Severity: (no value) > >       Owner: Nobody > >  Requestors: TIMB@cpan.org > >      Status: new > >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=56326 > > > > > > > Firstly, thanks! cpanminus is great. > > > > It's useful for cpanminus to be able to install many modules with a single command. We use something like "cpanm $(cat modules.txt)" to > > install/update many modules. > > > > The Test::Warn distro uses a .zip file so needs Archive::Zip installed. Sadly, adding Archive::Zip to modules.txt doesn't work because cpanm has > > already decided that's it's not available so won't use it, even though it's been installed by the time it's needed. > > > > Changing this chunk: > > > >      } elsif (eval { require Archive::Zip }) { > >          $self->chat("You have Archive::Zip $Archive::Zip::VERSION\n"); > >          $self->{_backends}{unzip} = sub { > >              my($self, $file) = @_; > >              my $zip = Archive::Zip->new(); > >              ... > >          }; > >      } else { > >          $self->{_backends}{unzip} = sub { > >              die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n"; > >          }; > >      } > > > > to something like this: > > > >      } else { > >          $self->{_backends}{unzip} = sub { > >              eval { require Archive::Zip } > >                  or die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n"; > >              my($self, $file) = @_; > >              my $zip = Archive::Zip->new(); > >              ... > >          }; > >      } > > > > would fix it. > >
> > > > -- > Tatsuhiko Miyagawa >