Changeset 11108


Ignore:
Timestamp:
03/13/10 16:23:40 (2 years ago)
Author:
adamk
Message:

Switched from pip to cpanm

Location:
trunk/Padre
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/Changes

    r11100 r11108  
    2222    - When showing a toolbar panel for the first time, make sure it's lock 
    2323      state is consistent with the main_lockinterface config setting (ADAMK) 
     24    - Local file and remote file installation switched from pip to 
     25      cpanm (ADAMK) 
    2426 
    25270.58 2010.03.08  **WARNING Still not stable** 
  • trunk/Padre/Makefile.PL

    r11088 r11108  
    4646 
    4747my $wxw = eval { use Alien::wxWidgets; 1; }; 
    48 if ( $@ || !$wxw ) { 
     48if ( $@ or not $wxw ) { 
    4949    print STDERR "Warning: prerequisite Alien::wxWidgets not found.\n"; 
    5050    exit 0; 
     
    7171requires 'perl'                  => '5.008005'; 
    7272requires 'App::Ack'              => '1.86'; 
     73requires 'App::cpanminus'        => '0.9922'; 
    7374requires 'Class::Adapter'        => '1.05'; 
    7475requires 'Class::Unload'         => '0.03'; 
     
    124125requires 'Parse::ErrorString::Perl' => '0.11'; 
    125126requires 'Parse::ExuberantCTags'    => '1.00'; 
    126 requires 'pip'                      => '0.13'; 
    127127requires 'Pod::POM'                 => '0.17'; 
    128128requires 'Pod::Simple'              => '3.07'; 
  • trunk/Padre/lib/Padre/Action/Tools.pm

    r11069 r11108  
    66use strict; 
    77use warnings; 
     8use File::Spec      (); 
    89use Params::Util    (); 
    910use Padre::Constant (); 
     
    185186} 
    186187 
     188 
     189 
     190 
     191 
    187192##################################################################### 
    188193# Module Tools 
     
    212217    } 
    213218 
    214     $self->install_pip( $main, $string ); 
     219    $self->install_cpanm( $main, $string ); 
    215220    return; 
    216221} 
     
    237242    } 
    238243 
    239     $self->install_pip( $main, $string ); 
     244    $self->install_cpanm( $main, $string ); 
    240245    return; 
    241246} 
    242247 
    243 sub install_pip { 
     248sub install_cpanm { 
    244249    my $self   = shift; 
    245250    my $main   = shift; 
    246251    my $module = shift; 
    247252 
    248     # Find 'pip', used to install modules 
    249     require File::Which; 
    250     my $pip = scalar File::Which::which('pip'); 
    251     unless ( -f $pip ) { 
    252         $main->error( Wx::gettext("pip is unexpectedly not installed") ); 
    253         return; 
    254     } 
    255  
    256     $main->setup_bindings; 
    257  
    258     # Run with console Perl to prevent unexpected results under wperl 
     253    # Find 'cpanm', used to install modules 
     254    require Config; 
     255    my %seen  = (); 
     256    my @where = grep { 
     257        defined $_ and length $_ and not $seen{$_}++ 
     258    } map { 
     259        $Config::Config{$_} 
     260    } qw{ 
     261        sitescriptexp 
     262        sitebinexp 
     263        vendorscriptexp 
     264        vendorbinexp 
     265        scriptdirexp 
     266        binexp 
     267    }; 
     268    my $cpanm = ''; 
     269    foreach my $dir ( @where ) { 
     270        my $path = File::Spec->catfile( $dir, 'cpanm' ); 
     271        if ( -f $path ) { 
     272            $cpanm = $path; 
     273            last; 
     274        } 
     275    } 
     276    unless ( $cpanm ) { 
     277        $main->error( Wx::gettext("cpanm is unexpectedly not installed") ); 
     278        return; 
     279    } 
     280 
     281    # Create the command 
    259282    my $perl = Padre::Perl::cperl(); 
    260     my $cmd  = qq{"$perl" "$pip" "$module"}; 
    261     local $ENV{AUTOMATED_TESTING} = 1; 
    262     Wx::Perl::ProcessStream::Process->new->Run( $cmd, 'CPAN_mod', $main ); 
     283    my $cmd  = qq{"$perl" "$cpanm" "$module"}; 
     284    $main->run_command($cmd); 
    263285 
    264286    return; 
Note: See TracChangeset for help on using the changeset viewer.