Changeset 5307


Ignore:
Timestamp:
06/18/09 07:38:42 (3 years ago)
Author:
szabgab
Message:

factor out mode code to the lib/Tools.pm file and fix the release script to work with the Perl6 plugin as well

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/dev.pl

    r5305 r5307  
    1010# No need to distribute it 
    1111use FindBin; 
    12 use File::Which    (); 
    1312use File::Basename (); 
    14 use Probe::Perl    (); 
    1513$ENV{PADRE_DEV}  = 1; 
    1614$ENV{PADRE_HOME} = $FindBin::Bin; 
     
    2826convert_po_to_mo($FindBin::Bin); 
    2927 
     28my $perl = get_perl(); 
    3029 
    31 my $perl = Probe::Perl->find_perl_interpreter; 
    32 if ( $^O eq 'darwin' ) { 
    33     # I presume there's a proper way to do this? 
    34     $perl = scalar File::Which::which('wxPerl'); 
    35     chomp($perl); 
    36     unless ( -e $perl ) { 
    37         error("padre needs to run using wxPerl on OSX"); 
    38     } 
    39 } 
    4030my @cmd = ( 
    4131    qq[$perl], 
  • trunk/tools/lib/Tools.pm

    r5305 r5307  
    44 
    55use base 'Exporter'; 
    6 our @EXPORT = qw(convert_po_to_mo); 
     6our @EXPORT = qw(convert_po_to_mo get_perl); 
     7 
     8use File::Which    (); 
     9use Probe::Perl    (); 
     10use File::Basename (); 
     11if ( $^O eq 'MSWin32' ) { 
     12    # "Default glob() will misinterpret spaces in folder names as seperators, install File::Glob::Windows to fix this behavior!"); 
     13    require File::Glob::Windows; 
     14} 
    715 
    816sub convert_po_to_mo { 
     
    3745        $msgfmt = scalar File::Which::which('msgfmt'); 
    3846    } elsif ( $^O eq 'MSWin32' ) { 
    39         eval { 
    40             require File::Glob::Windows; 
    41         }; 
    42         if( $@ ) { 
    43             die("Default glob() will misinterpret spaces in folder names as seperators, install File::Glob::Windows to fix this behavior!"); 
    44         } 
    4547        my $p = "C:/Program Files/GnuWin32/bin/msgfmt.exe"; 
    4648        if ( -e $p ) { 
     
    5456} 
    5557 
     58sub get_perl { 
     59    my $perl = Probe::Perl->find_perl_interpreter; 
     60    if ( $^O eq 'darwin' ) { 
     61        # I presume there's a proper way to do this? 
     62        $perl = scalar File::Which::which('wxPerl'); 
     63        chomp($perl); 
     64        unless ( -e $perl ) { 
     65            error("padre needs to run using wxPerl on OSX"); 
     66        } 
     67    } 
     68} 
     69 
    56701; 
  • trunk/tools/release.pl

    r5282 r5307  
    1515use File::Slurp    qw(read_file write_file); 
    1616use File::Temp     (); 
     17use FindBin; 
     18 
     19use lib $FindBin::Bin; 
     20use lib::Tools; 
    1721 
    1822my $SVN     = "http://svn.perlide.org/padre"; 
     
    5458} 
    5559 
    56 my $dir = File::Temp::tempdir( CLEANUP => 1 ); 
     60my $dir = File::Temp::tempdir( CLEANUP => 0 ); 
    5761chdir $dir; 
    5862print "DIR $dir\n"; 
     
    6165chdir 'src'; 
    6266 
    63 if ($name eq 'Padre') { 
    64     my @LOCALES = map { substr(File::Basename::basename($_), 0, -3) } glob "share/locale/*.po"; 
    65     for my $locale ( @LOCALES ) { 
    66         _system("msgfmt -o share/locale/$locale.mo share/locale/$locale.po"); 
     67my $locale_path; 
     68if (-d 'share/locale') { 
     69    $locale_path = Cwd::cwd(); 
     70} else { 
     71    (my $path = $name) =~ s{-}{/}g; 
     72    if (-d "lib/$path/share/locale") { 
     73        $locale_path = Cwd::cwd() . "/lib/$path"; 
    6774    } 
     75} 
     76 
     77if ($locale_path) { 
     78    print "locale path: '$locale_path'\n"; 
     79    convert_po_to_mo($locale_path); 
    6880} 
    6981 
     
    7284die if $error; 
    7385 
    74 my $make = $^O eq 'freebsd' ? 'HARNESS_DEBUG=1 gmake' : 'make'; 
    75 my $makefile_pl; 
     86my $make         = $^O eq 'freebsd' ? 'HARNESS_DEBUG=1 gmake' : 'make'; 
     87my $makefile_pl  = "Makefile.PL"; 
    7688if(-f "Build.PL") { 
    7789    $makefile_pl = "Build.PL"; 
    7890    $make = "./Build"; 
    79 } else { 
    80     $makefile_pl = "Makefile.PL"; 
    8191} 
    8292_system("$^X $makefile_pl"); 
Note: See TracChangeset for help on using the changeset viewer.