Changeset 5853


Ignore:
Timestamp:
07/05/09 21:45:03 (3 years ago)
Author:
ryan52
Message:
  • add Module::Install::Msgfmt. just replace install_share with install_share_with_mofiles in your Makefile.PL.
  • add remove option to remove the source file(s) and all .pot files if a directory is being processed
  • add verbose option to print the files that were converted
Location:
trunk/Locale-Msgfmt
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Locale-Msgfmt/Changes

    r5729 r5853  
    66        - use is_deeply instead of making a string out of the hash and 
    77          then using is 
     8        - add Module::Install::Msgfmt. just replace install_share with 
     9          install_share_with_mofiles in your Makefile.PL. 
     10        - add remove option to remove the source file(s) and all .pot 
     11          files if a directory is being processed 
     12        - add verbose option to print the files that were converted 
    813 
    9140.08    Jun 27, 2009 
  • trunk/Locale-Msgfmt/lib/Locale/Msgfmt.pm

    r5660 r5853  
    5858  $mo->prepare(); 
    5959  $mo->out($hash->{out}); 
     60  print $hash->{in} . " -> " . $hash->{out} . "\n" if($hash->{verbose}); 
     61  unlink($hash->{in}) if($hash->{remove}); 
    6062} 
    6163 
     
    7476  my @list = readdir D; 
    7577  closedir D; 
     78  my @removelist = (); 
     79  if($hash->{remove}) { 
     80    @removelist = grep /\.pot$/, @list; 
     81  } 
    7682  @list = grep /\.po$/, @list; 
    7783  my %files; 
     
    8187    $files{$in} = $out; 
    8288  } 
    83   delete $hash->{in}; 
    84   delete $hash->{out}; 
    8589  foreach(keys %files) { 
    8690    my %newhash = (%{$hash}); 
     
    8892    $newhash{out} = $files{$_}; 
    8993    _msgfmt(\%newhash); 
     94  } 
     95  foreach(@removelist) { 
     96    my $f = File::Spec->catfile($hash->{in}, $_); 
     97    print "-$f\n" if($hash->{verbose}); 
     98    unlink($f); 
    9099  } 
    91100} 
Note: See TracChangeset for help on using the changeset viewer.