r66225 - in /trunk/liblocale-msgfmt-perl: ./ bin/ debian/ debian/source/ dev/ inc/ lib/Locale/ lib/Locale/Msgfmt/ lib/Module/Install/ private/ script/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Dec 24 21:16:17 UTC 2010
Author: jawnsy-guest
Date: Fri Dec 24 21:16:03 2010
New Revision: 66225
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66225
Log:
* New upstream release
* Standards-Version 3.9.1 (no changes)
* Add myself to Uploaders and Copyright
Added:
trunk/liblocale-msgfmt-perl/debian/source/
trunk/liblocale-msgfmt-perl/debian/source/format
trunk/liblocale-msgfmt-perl/inc/
- copied from r66224, branches/upstream/liblocale-msgfmt-perl/current/inc/
trunk/liblocale-msgfmt-perl/private/
- copied from r66224, branches/upstream/liblocale-msgfmt-perl/current/private/
trunk/liblocale-msgfmt-perl/script/
- copied from r66224, branches/upstream/liblocale-msgfmt-perl/current/script/
Removed:
trunk/liblocale-msgfmt-perl/Build.PL
trunk/liblocale-msgfmt-perl/bin/
trunk/liblocale-msgfmt-perl/dev/
trunk/liblocale-msgfmt-perl/t/pod.t
Modified:
trunk/liblocale-msgfmt-perl/Changes
trunk/liblocale-msgfmt-perl/MANIFEST
trunk/liblocale-msgfmt-perl/META.yml
trunk/liblocale-msgfmt-perl/Makefile.PL
trunk/liblocale-msgfmt-perl/debian/changelog
trunk/liblocale-msgfmt-perl/debian/control
trunk/liblocale-msgfmt-perl/debian/copyright
trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt.pm
trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/Utils.pm
trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/mo.pm
trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/po.pm
trunk/liblocale-msgfmt-perl/lib/Module/Install/Msgfmt.pm
trunk/liblocale-msgfmt-perl/t/00-load.t
trunk/liblocale-msgfmt-perl/t/interface.t
trunk/liblocale-msgfmt-perl/t/msgfmt.t
trunk/liblocale-msgfmt-perl/t/version.t
Modified: trunk/liblocale-msgfmt-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/Changes?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/Changes (original)
+++ trunk/liblocale-msgfmt-perl/Changes Fri Dec 24 21:16:03 2010
@@ -1,11 +1,21 @@
Revision history for Locale-Msgfmt
+
+0.15 Nov 07, 2010
+ - General code cleaning (ADAMK)
+ - Changes to Module::Install::Msgfmt to make it compatible with
+ Module::Install::Share. (ADAMK)
+ - Moved script from bin/ to script/ (ADAMK)
+ - Moved private tools from dev to private (ADAMK)
+ - Picking 5.008005 as our minimum Perl to ensure solid Unicode support (ADAMK)
+ - Converted the Build.PL to a Module::Install Makefile.PL (ADAMK)
+ - Fixed it so that it actually works (AZAWAWI)
0.14 Jul 09, 2009
- fix a mess with Module::Install::Msgfmt :P
0.13 Jul 08, 2009
- act like make when rebuilding, only rebuild things that need to be rebuilt.
- - add a --force option to force the old behavior of always rebuilding
+ - add a --force option to force the old behavior of always rebuilding
- make the "use" in msgfmt.pl versioned to make sure that the correct version
of Locale::Msgfmt is being used, and add a test to keep this up to date
@@ -65,4 +75,3 @@
0.01 Jun 24, 2009
- First version, released on an unsuspecting world.
-
Modified: trunk/liblocale-msgfmt-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/MANIFEST?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/MANIFEST (original)
+++ trunk/liblocale-msgfmt-perl/MANIFEST Fri Dec 24 21:16:03 2010
@@ -1,21 +1,30 @@
-bin/msgfmt.pl
-Build.PL
Changes
-dev/compare
-dev/compare-all
-dev/dump-mo
-dev/dump-po
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/DSL.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
lib/Locale/Msgfmt.pm
lib/Locale/Msgfmt/mo.pm
lib/Locale/Msgfmt/po.pm
lib/Locale/Msgfmt/Utils.pm
lib/Module/Install/Msgfmt.pm
+Makefile.PL
MANIFEST This list of files
+META.yml
+private/compare
+private/compare-all
+private/dump-mo
+private/dump-po
README
+script/msgfmt.pl
t/00-load.t
t/interface.t
t/msgfmt.t
-t/pod.t
t/samples/basic.mo
t/samples/basic.po
t/samples/build
@@ -27,5 +36,3 @@
t/samples/ngettext.mo
t/samples/ngettext.po
t/version.t
-Makefile.PL
-META.yml
Modified: trunk/liblocale-msgfmt-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/META.yml?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/META.yml (original)
+++ trunk/liblocale-msgfmt-perl/META.yml Fri Dec 24 21:16:03 2010
@@ -1,31 +1,28 @@
---
+abstract: 'Compile .po files to .mo files'
+author:
+ - 'Ryan Niebur, all rights reserved.'
+build_requires:
+ ExtUtils::MakeMaker: 6.42
+ Test::More: 0.47
+configure_requires:
+ ExtUtils::MakeMaker: 6.42
+distribution_type: module
+generated_by: 'Module::Install version 1.00'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+module_name: Locale::Msgfmt
name: Locale-Msgfmt
-version: 0.14
-author:
- - 'Ryan Niebur <ryanryan52 at gmail.com>'
-abstract: Compile .po files to .mo files
-license: perl
+no_index:
+ directory:
+ - inc
+ - private
+ - t
+requires:
+ File::Spec: 0.80
+ perl: 5.8.5
resources:
- license: ~
-build_requires:
- Test::More: 0
-provides:
- Locale::Msgfmt:
- file: lib/Locale/Msgfmt.pm
- version: 0.14
- Locale::Msgfmt::Utils:
- file: lib/Locale/Msgfmt/Utils.pm
- version: 0.14
- Locale::Msgfmt::mo:
- file: lib/Locale/Msgfmt/mo.pm
- version: 0.14
- Locale::Msgfmt::po:
- file: lib/Locale/Msgfmt/po.pm
- version: 0.14
- Module::Install::Msgfmt:
- file: lib/Module/Install/Msgfmt.pm
- version: 0.14
-generated_by: Module::Build version 0.32
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
+ license: http://dev.perl.org/licenses/
+version: 0.15
Modified: trunk/liblocale-msgfmt-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/Makefile.PL?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/Makefile.PL (original)
+++ trunk/liblocale-msgfmt-perl/Makefile.PL Fri Dec 24 21:16:03 2010
@@ -1,15 +1,7 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.32
-use ExtUtils::MakeMaker;
-WriteMakefile
-(
- 'NAME' => 'Locale::Msgfmt',
- 'VERSION_FROM' => 'lib/Locale/Msgfmt.pm',
- 'PREREQ_PM' => {
- 'Test::More' => 0
- },
- 'INSTALLDIRS' => 'site',
- 'EXE_FILES' => [
- 'bin/msgfmt.pl'
- ]
- )
-;
+use inc::Module::Install::DSL 0.92;
+
+all_from lib/Locale/Msgfmt.pm
+requires File::Spec 0.80
+test_requires Test::More 0.47
+test_requires Locale::Maketext::Gettext 1.28 if $ENV{AUTOMATED_TESTING}
+no_index directory private
Modified: trunk/liblocale-msgfmt-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/debian/changelog?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/debian/changelog (original)
+++ trunk/liblocale-msgfmt-perl/debian/changelog Fri Dec 24 21:16:03 2010
@@ -1,4 +1,9 @@
-liblocale-msgfmt-perl (0.14-2) UNRELEASED; urgency=low
+liblocale-msgfmt-perl (0.15-1) UNRELEASED; urgency=low
+
+ [ Jonathan Yu ]
+ * New upstream release
+ * Standards-Version 3.9.1 (no changes)
+ * Add myself to Uploaders and Copyright
[ Salvatore Bonaccorso ]
* debian/control: Changed: Replace versioned (build-)dependency on
@@ -13,7 +18,7 @@
* Bump debhelper build dependency version, remove build-dependency on
Module::Build.
- -- Ryan Niebur <ryan at debian.org> Fri, 25 Sep 2009 00:25:19 -0700
+ -- Jonathan Yu <jawnsy at cpan.org> Fri, 24 Dec 2010 16:29:13 -0500
liblocale-msgfmt-perl (0.14-1) unstable; urgency=low
Modified: trunk/liblocale-msgfmt-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/debian/control?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/debian/control (original)
+++ trunk/liblocale-msgfmt-perl/debian/control Fri Dec 24 21:16:03 2010
@@ -4,8 +4,8 @@
Build-Depends: debhelper (>= 7.0.50~)
Build-Depends-Indep: perl, libtest-pod-perl, liblocale-maketext-gettext-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ryan Niebur <ryan at debian.org>
-Standards-Version: 3.8.2
+Uploaders: Ryan Niebur <ryan at debian.org>, Jonathan Yu <jawnsy at cpan.org>
+Standards-Version: 3.9.1
Homepage: http://search.cpan.org/dist/Locale-Msgfmt/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liblocale-msgfmt-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/liblocale-msgfmt-perl/
Modified: trunk/liblocale-msgfmt-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/debian/copyright?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/debian/copyright (original)
+++ trunk/liblocale-msgfmt-perl/debian/copyright Fri Dec 24 21:16:03 2010
@@ -1,16 +1,14 @@
-Format-Specification:
- http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: Ryan Niebur <ryan at debian.org>
-Upstream-Source: http://search.cpan.org/dist/Locale-Msgfmt/
-Upstream-Name: Locale-Msgfmt
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Ryan Niebur <ryan at debian.org>
+Source: http://search.cpan.org/dist/Locale-Msgfmt/
+Name: Locale-Msgfmt
Files: *
Copyright: 2009, Ryan Niebur <ryan at debian.org>
-License-Alias: Perl
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
Files: t/samples/ja.po
-Copyright: Copyright (C) 2009 The Padre development team as listed in Padre.pm:
+Copyright: 2009, The Padre development team as listed in Padre.pm:
Aaron Trevena (TEEJAY)
Ahmad Zawawi XXXX XXXX XXXXX (AZAWAWI)
Adam Kennedy (ADAMK) <adamk at cpan.org>
@@ -31,22 +29,25 @@
PaweX Murias (PMURIAS)
Petar Shangov (PSHANGOV)
Steffen Mueller (TSEE) <smueller at cpan.org>
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
Files: debian/*
-Copyright: 2009, Ryan Niebur <ryan at debian.org>
-License: Artistic | GPL-1+
+Copyright: 2010, Jonathan Yu <jawnsy at cpan.org>
+ 2009, Ryan Niebur <ryanryan52 at gmail.com>
+License: Artistic or GPL-1+
License: Artistic
- This program is free software; you can redistribute it and/or modify
- it under the terms of the Artistic License, which comes with Perl.
- On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the Artistic License, which comes with Perl.
+ .
+ On Debian GNU/Linux systems, the complete text of the Artistic License
+ can be found in `/usr/share/common-licenses/Artistic'.
License: GPL-1+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 1, or (at your option)
- any later version.
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian GNU/Linux systems, the complete text of version 1 of the
+ General Public License can be found in `/usr/share/common-licenses/GPL-1'.
Added: trunk/liblocale-msgfmt-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/debian/source/format?rev=66225&op=file
==============================================================================
--- trunk/liblocale-msgfmt-perl/debian/source/format (added)
+++ trunk/liblocale-msgfmt-perl/debian/source/format Fri Dec 24 21:16:03 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)
Modified: trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt.pm?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt.pm (original)
+++ trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt.pm Fri Dec 24 21:16:03 2010
@@ -1,45 +1,43 @@
package Locale::Msgfmt;
-use Locale::Msgfmt::mo;
-use Locale::Msgfmt::po;
-use Locale::Msgfmt::Utils;
-use File::Path;
-use File::Spec;
-
+use 5.008005;
use strict;
use warnings;
+use Exporter ();
+use File::Spec ();
+use Locale::Msgfmt::mo ();
+use Locale::Msgfmt::po ();
+use Locale::Msgfmt::Utils ();
-use base 'Exporter';
-
-our @EXPORT = qw/msgfmt/;
-
-our $VERSION = '0.14';
+our $VERSION = '0.15';
+our @ISA = 'Exporter';
+our @EXPORT = qw/msgfmt/;
sub do_msgfmt_for_module_install {
my $lib = shift;
my $sharepath = shift;
my $fullpath = File::Spec->catfile( $lib, $sharepath, 'locale' );
- if ( !-d $fullpath ) {
- die("$fullpath isn't a directory");
+ unless ( -d $fullpath ) {
+ die "$fullpath isn't a directory";
}
msgfmt( { in => $fullpath, verbose => 1, remove => 1 } );
}
sub msgfmt {
my $hash = shift;
- if ( !defined($hash) ) {
- die("error: must give input");
+ unless ( defined($hash) ) {
+ die "error: must give input";
}
- if ( !( ref($hash) eq "HASH" ) ) {
+ unless ( ref($hash) eq "HASH" ) {
$hash = { in => $hash };
}
- if ( !defined( $hash->{in} ) or !length( $hash->{in} ) ) {
- die("error: must give an input file");
+ unless ( defined $hash->{in} and length $hash->{in} ) {
+ die "error: must give an input file";
}
- if ( !-e $hash->{in} ) {
- die("error: input does not exist");
+ unless ( -e $hash->{in} ) {
+ die "error: input does not exist";
}
- if ( !defined( $hash->{verbose} ) ) {
+ unless ( defined $hash->{verbose} ) {
$hash->{verbose} = 1;
}
if ( -d $hash->{in} ) {
@@ -51,76 +49,81 @@
sub _msgfmt {
my $hash = shift;
- if ( !defined( $hash->{in} ) ) {
- die("error: must give an input file");
+ unless ( defined $hash->{in} ) {
+ die "error: must give an input file";
}
- if ( !-f $hash->{in} ) {
- die("error: input file does not exist");
+ unless ( -f $hash->{in} ) {
+ die "error: input file does not exist";
}
- if ( !defined( $hash->{out} ) ) {
- if ( $hash->{in} =~ /\.po$/ ) {
- $hash->{out} = $hash->{in};
- $hash->{out} =~ s/po$/mo/;
- } else {
- die("error: must give an output file");
+ unless ( defined $hash->{out} ) {
+ unless ( $hash->{in} =~ /\.po$/ ) {
+ die "error: must give an output file";
+ }
+ $hash->{out} = $hash->{in};
+ $hash->{out} =~ s/po$/mo/;
+ }
+ unless ( $hash->{force} ) {
+ my $min = Locale::Msgfmt::Utils::mtime( $hash->{in} );
+ my $mout = Locale::Msgfmt::Utils::mtime( $hash->{out} );
+ if ( -f $hash->{out} and $mout > $min ) {
+ return;
}
}
- unless ( $hash->{force} ) {
- return
- if ( -f $hash->{out}
- && Locale::Msgfmt::Utils::mtime( $hash->{out} ) > Locale::Msgfmt::Utils::mtime( $hash->{in} ) );
- }
- my $mo = Locale::Msgfmt::mo->new();
- $mo->initialize();
+ my $mo = Locale::Msgfmt::mo->new;
+ $mo->initialize;
my $po = Locale::Msgfmt::po->new( { fuzzy => $hash->{fuzzy} } );
$po->parse( $hash->{in}, $mo );
- $mo->prepare();
- unlink( $hash->{out} ) if ( -f $hash->{out} );
+ $mo->prepare;
+ unlink( $hash->{out} ) if -f $hash->{out};
$mo->out( $hash->{out} );
- print $hash->{in} . " -> " . $hash->{out} . "\n" if ( $hash->{verbose} );
- unlink( $hash->{in} ) if ( $hash->{remove} );
+ print $hash->{in} . " -> " . $hash->{out} . "\n" if $hash->{verbose};
+ unlink( $hash->{in} ) if $hash->{remove};
}
sub _msgfmt_dir {
my $hash = shift;
- if ( !-d $hash->{in} ) {
+ unless ( -d $hash->{in} ) {
die("error: input directory does not exist");
}
- if ( !defined( $hash->{out} ) ) {
+ unless ( defined $hash->{out} ) {
$hash->{out} = $hash->{in};
}
- if ( !-d $hash->{out} ) {
+ unless ( -d $hash->{out} ) {
File::Path::mkpath( $hash->{out} );
}
- print $hash->{in} . " -> " . $hash->{out} . "\n" if ( $hash->{verbose} );
- opendir my $D, $hash->{in} or die "Could not open ($hash->{in}) $!";
- my @list = readdir $D;
- closedir $D;
+
+ print "$hash->{in} -> $hash->{out}\n" if $hash->{verbose};
+
+ local *DIRECTORY;
+ opendir( DIRECTORY, $hash->{in} ) or die "Could not open ($hash->{in}) $!";
+ my @list = readdir DIRECTORY;
+ closedir DIRECTORY;
+
my @removelist = ();
if ( $hash->{remove} ) {
@removelist = grep /\.pot$/, @list;
}
@list = grep /\.po$/, @list;
+
my %files;
- foreach (@list) {
- my $in = File::Spec->catfile( $hash->{in}, $_ );
+ foreach ( @list ) {
+ my $in = File::Spec->catfile( $hash->{in}, $_ );
my $out = File::Spec->catfile( $hash->{out}, substr( $_, 0, -3 ) . ".mo" );
$files{$in} = $out;
}
foreach ( keys %files ) {
- my %newhash = ( %{$hash} );
- $newhash{in} = $_;
- $newhash{out} = $files{$_};
- _msgfmt( \%newhash );
+ _msgfmt( { %$hash, in => $_, out => $files{$_} } );
}
- foreach (@removelist) {
+ foreach ( @removelist ) {
my $f = File::Spec->catfile( $hash->{in}, $_ );
- print "-$f\n" if ( $hash->{verbose} );
+ print "-$f\n" if $hash->{verbose};
unlink($f);
}
}
1;
+
+=pod
=head1 NAME
@@ -132,29 +135,36 @@
except this is pure Perl. The interface is best explained through
examples:
- use Locale::Msgfmt;
+ use Locale::Msgfmt;
- # compile po/fr.po into po/fr.mo
- msgfmt({in => "po/fr.po", out => "po/fr.mo"});
- # compile po/fr.po into po/fr.mo and include fuzzy translations
- msgfmt({in => "po/fr.po", out => "po/fr.mo", fuzzy => 1});
- # compile all the .po files in the po directory, and write the .mo
- # files to the po directory
- msgfmt("po/");
- # compile all the .po files in the po directory, and write the .mo
- # files to the po directory, and include fuzzy translations
- msgfmt({in => "po/", fuzzy => 1});
- # compile all the .po files in the po directory, and write the .mo
- # files to the output directory, creating the output directory if
- # it doesn't already exist
- msgfmt({in => "po/", out => "output/"});
- # compile all the .po files in the po directory, and write the .mo
- # files to the output directory, and include fuzzy translations
- msgfmt({in => "po/", out => "output/", fuzzy => 1});
- # compile po/fr.po into po/fr.mo
- msgfmt("po/fr.po");
- # compile po/fr.po into po/fr.mo and include fuzzy translations
- msgfmt({in => "po/fr.po", fuzzy => 1});
+ # Compile po/fr.po into po/fr.mo
+ msgfmt({in => "po/fr.po", out => "po/fr.mo"});
+
+ # Compile po/fr.po into po/fr.mo and include fuzzy translations
+ msgfmt({in => "po/fr.po", out => "po/fr.mo", fuzzy => 1});
+
+ # Compile all the .po files in the po directory, and write the .mo
+ # files to the po directory
+ msgfmt("po/");
+
+ # Compile all the .po files in the po directory, and write the .mo
+ # files to the po directory, and include fuzzy translations
+ msgfmt({in => "po/", fuzzy => 1});
+
+ # Compile all the .po files in the po directory, and write the .mo
+ # files to the output directory, creating the output directory if
+ # it doesn't already exist
+ msgfmt({in => "po/", out => "output/"});
+
+ # Compile all the .po files in the po directory, and write the .mo
+ # files to the output directory, and include fuzzy translations
+ msgfmt({in => "po/", out => "output/", fuzzy => 1});
+
+ # Compile po/fr.po into po/fr.mo
+ msgfmt("po/fr.po");
+
+ # Compile po/fr.po into po/fr.mo and include fuzzy translations
+ msgfmt({in => "po/fr.po", fuzzy => 1});
=head1 COPYRIGHT & LICENSE
@@ -163,5 +173,4 @@
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
-
=cut
Modified: trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/Utils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/Utils.pm?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/Utils.pm (original)
+++ trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/Utils.pm Fri Dec 24 21:16:03 2010
@@ -1,9 +1,10 @@
package Locale::Msgfmt::Utils;
+use 5.008005;
use strict;
use warnings;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
sub character {
return map { pack "N*", $_ } @_;
@@ -57,9 +58,15 @@
return @{ [ stat(shift) ] }[9];
}
+1;
+
+__END__
+
+=pod
+
=head1 NAME
-Locale::Msgfmt::Utils - functions used internally by Locale::Msgfmt
+Locale::Msgfmt::Utils - Functions used internally by Locale::Msgfmt
=head1 SYNOPSIS
@@ -70,5 +77,3 @@
L<Locale::Msgfmt>
=cut
-
-1;
Modified: trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/mo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/mo.pm?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/mo.pm (original)
+++ trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/mo.pm Fri Dec 24 21:16:03 2010
@@ -1,11 +1,11 @@
package Locale::Msgfmt::mo;
+use 5.008005;
use strict;
use warnings;
+use Locale::Msgfmt::Utils ();
-our $VERSION = '0.14';
-
-use Locale::Msgfmt::Utils;
+our $VERSION = '0.15';
sub new {
return bless {}, shift;
@@ -19,19 +19,17 @@
}
sub add_string {
- my ( $self, $string, $translation ) = @_;
- $self->{strings}->{$string} = $translation;
+ $_[0]->{strings}->{$_[1]} = $_[2];
}
sub prepare {
my $self = shift;
- $self->{count} = scalar keys %{ $self->{strings} };
- $self->{free_mem} = 28 + $self->{count} * 16;
- @{ $self->{sorted} } = sort keys %{ $self->{strings} };
- @{ $self->{translations} } = ();
- foreach ( @{ $self->{sorted} } ) {
- push @{ $self->{translations} }, $self->{strings}->{$_};
- }
+ $self->{count} = scalar keys %{ $self->{strings} };
+ $self->{free_mem} = 28 + $self->{count} * 16;
+ $self->{sorted} = [ sort keys %{ $self->{strings} } ];
+ $self->{translations} = [
+ map { $self->{strings}->{$_} } @{ $self->{sorted} }
+ ];
}
sub out {
@@ -68,6 +66,12 @@
close $OUT;
}
+1;
+
+__END__
+
+=pod
+
=head1 NAME
Locale::Msgfmt::mo - class used internally by Locale::Msgfmt
@@ -81,5 +85,3 @@
L<Locale::Msgfmt>
=cut
-
-1;
Modified: trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/po.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/po.pm?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/po.pm (original)
+++ trunk/liblocale-msgfmt-perl/lib/Locale/Msgfmt/po.pm Fri Dec 24 21:16:03 2010
@@ -1,11 +1,11 @@
package Locale::Msgfmt::po;
-use Locale::Msgfmt::Utils;
-
+use 5.008005;
use strict;
use warnings;
+use Locale::Msgfmt::Utils ();
-our $VERSION = '0.14';
+our $VERSION = '0.15';
sub new {
my $class = shift;
@@ -103,6 +103,12 @@
$self->read_po($pofile);
}
+1;
+
+__END__
+
+=pod
+
=head1 NAME
Locale::Msgfmt::po - class used internally by Locale::Msgfmt
@@ -116,5 +122,3 @@
L<Locale::Msgfmt>
=cut
-
-1;
Modified: trunk/liblocale-msgfmt-perl/lib/Module/Install/Msgfmt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/lib/Module/Install/Msgfmt.pm?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/lib/Module/Install/Msgfmt.pm (original)
+++ trunk/liblocale-msgfmt-perl/lib/Module/Install/Msgfmt.pm Fri Dec 24 21:16:03 2010
@@ -1,26 +1,26 @@
package Module::Install::Msgfmt;
+use 5.008005;
use strict;
-use File::Spec;
+use warnings;
+use File::Spec ();
use Module::Install::Base ();
-use Module::Install::Share;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
our @ISA = 'Module::Install::Base';
sub install_share_with_mofiles {
+ my $self = shift;
my @orig = (@_);
- my $self = shift;
my $class = ref($self);
my $prefix = $self->_top->{prefix};
my $name = $self->_top->{name};
- my $dir = @_ ? pop : 'share';
+ my $dir = @_ ? pop : 'share';
my $type = @_ ? shift : 'dist';
my $module = @_ ? shift : '';
- $self->build_requires( 'Locale::Msgfmt' => '0.14' );
- install_share(@orig);
+ $self->build_requires( 'Locale::Msgfmt' => '0.15' );
+ $self->install_share(@orig);
my $distname = "";
-
if ( $type eq 'dist' ) {
$distname = $self->name;
} else {
@@ -34,3 +34,5 @@
END_MAKEFILE
}
+
+1;
Modified: trunk/liblocale-msgfmt-perl/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/t/00-load.t?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/t/00-load.t (original)
+++ trunk/liblocale-msgfmt-perl/t/00-load.t Fri Dec 24 21:16:03 2010
@@ -1,9 +1,10 @@
-#!perl -T
+#!/usr/bin/perl
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
use Test::More tests => 1;
-BEGIN {
- use_ok('Locale::Msgfmt');
-}
-
-diag("Testing Locale::Msgfmt $Locale::Msgfmt::VERSION, Perl $], $^X");
+use_ok('Locale::Msgfmt');
Modified: trunk/liblocale-msgfmt-perl/t/interface.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/t/interface.t?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/t/interface.t (original)
+++ trunk/liblocale-msgfmt-perl/t/interface.t Fri Dec 24 21:16:03 2010
@@ -1,57 +1,69 @@
-#!perl
+#!/usr/bin/perl
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
use Test::More tests => 8;
-
-use Locale::Msgfmt;
+use File::Spec;
use File::Temp;
use File::Copy;
-use File::Spec;
use File::Path;
+use Locale::Msgfmt;
sub slurp {
my $file = shift;
- open my $F, '<', $file or die "Could not open ($file) $!";
- binmode $F;
- my $s = "";
- while (<$F>) { $s .= $_; }
- close $F;
- return $s;
+ local *FILE;
+ open FILE, '<', $file or die "Could not open ($file) $!";
+ binmode FILE;
+ my $string = "";
+ while ( <FILE> ) {
+ $string .= $_;
+ }
+ close FILE;
+ return $string;
}
-$dir = File::Temp::tempdir( CLEANUP => 0 );
+my $dir = File::Temp::tempdir( CLEANUP => 0 );
copy( File::Spec->catfile( "t", "samples", "basic.po" ), File::Spec->catfile( $dir, "basic.po" ) );
msgfmt( File::Spec->catfile( $dir, "basic.po" ) );
ok( -f File::Spec->catfile( $dir, "basic.mo" ) );
unlink File::Spec->catfile( $dir, "basic.mo" );
+
msgfmt( { in => File::Spec->catfile( $dir, "basic.po" ) } );
ok( -f File::Spec->catfile( $dir, "basic.mo" ) );
unlink File::Spec->catfile( $dir, "basic.mo" );
+
msgfmt( { in => File::Spec->catfile( $dir, "basic.po" ), out => File::Spec->catfile( $dir, "mo" ) } );
ok( -f File::Spec->catfile( $dir, "mo" ) );
unlink( File::Spec->catfile( $dir, "mo" ) );
+
mkdir( File::Spec->catdir( $dir, "a" ) );
mkdir( File::Spec->catdir( $dir, "b" ) );
move( File::Spec->catfile( $dir, "basic.po" ), File::Spec->catfile( $dir, "a", "basic.po" ) );
msgfmt( File::Spec->catdir( $dir, "a" ) );
ok( -f File::Spec->catfile( $dir, "a", "basic.mo" ) );
unlink File::Spec->catfile( $dir, "a", "basic.mo" );
+
msgfmt( { in => File::Spec->catdir( $dir, "a" ) } );
ok( -f File::Spec->catfile( $dir, "a", "basic.mo" ) );
unlink File::Spec->catfile( $dir, "a", "basic.mo" );
+
msgfmt( { in => File::Spec->catdir( $dir, "a" ), out => File::Spec->catdir( $dir, "b" ), } );
ok( -f File::Spec->catfile( $dir, "b", "basic.mo" ) );
unlink( File::Spec->catfile( $dir, "b", "basic.mo" ) );
+
move( File::Spec->catfile( $dir, "a", "basic.po" ), File::Spec->catfile( $dir, "basic.po" ) );
msgfmt( { in => File::Spec->catfile( $dir, "basic.po" ), fuzzy => 1, out => File::Spec->catfile( $dir, "fuzzy" ) } );
msgfmt( { in => File::Spec->catfile( $dir, "basic.po" ), out => File::Spec->catfile( $dir, "not_fuzzy" ) } );
ok( !( slurp( File::Spec->catfile( $dir, "not_fuzzy" ) ) eq slurp( File::Spec->catfile( $dir, "fuzzy" ) ) ) );
unlink( File::Spec->catfile( $dir, "not_fuzzy" ) );
unlink( File::Spec->catfile( $dir, "fuzzy" ) );
+
move( File::Spec->catfile( $dir, "basic.po" ), File::Spec->catfile( $dir, "a", "basic.po" ) );
msgfmt( { in => File::Spec->catfile( $dir, "a" ), fuzzy => 1, out => File::Spec->catfile( $dir, "b" ) } );
msgfmt( { in => File::Spec->catfile( $dir, "a" ), out => File::Spec->catfile( $dir, "c" ) } );
-ok( !( slurp( File::Spec->catfile( $dir, "b", "basic.mo" ) ) eq slurp( File::Spec->catfile( $dir, "c", "basic.mo" ) ) )
-);
+ok( !( slurp( File::Spec->catfile( $dir, "b", "basic.mo" ) ) eq slurp( File::Spec->catfile( $dir, "c", "basic.mo" ) ) ) );
unlink( File::Spec->catfile( $dir, "c", "basic.mo" ) );
unlink( File::Spec->catfile( $dir, "b", "basic.mo" ) );
-
Modified: trunk/liblocale-msgfmt-perl/t/msgfmt.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/t/msgfmt.t?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/t/msgfmt.t (original)
+++ trunk/liblocale-msgfmt-perl/t/msgfmt.t Fri Dec 24 21:16:03 2010
@@ -1,17 +1,22 @@
-#!perl
+#!/usr/bin/perl
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
use Test::More tests => 5;
-
+use File::Spec;
+use File::Temp;
use Locale::Msgfmt;
-use File::Temp;
-use File::Spec;
SKIP: {
- skip "Test needs Locale::Maketext::Gettext", 5 if ( !eval("use Locale::Maketext::Gettext; 1;") );
+ unless ( eval("use Locale::Maketext::Gettext; 1;") ) {
+ skip( "Test needs Locale::Maketext::Gettext", 5 );
+ }
sub my_read_mo {
- my %h = read_mo(shift);
- return \%h;
+ return +{ read_mo(shift) };
}
sub my_msgfmt {
@@ -19,10 +24,7 @@
close $fh;
my $in = shift;
utime( undef, undef, $in );
- my $fuzzy = 0;
- if (shift) {
- $fuzzy = 1;
- }
+ my $fuzzy = $_[0] ? 1 : 0;
msgfmt( { in => $in, out => $filename, fuzzy => $fuzzy } );
return $filename;
}
@@ -49,4 +51,3 @@
do_one_test("context");
do_one_test("ngettext");
}
-
Modified: trunk/liblocale-msgfmt-perl/t/version.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblocale-msgfmt-perl/t/version.t?rev=66225&op=diff
==============================================================================
--- trunk/liblocale-msgfmt-perl/t/version.t (original)
+++ trunk/liblocale-msgfmt-perl/t/version.t Fri Dec 24 21:16:03 2010
@@ -1,27 +1,34 @@
-#!perl
+#!/usr/bin/perl
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
use Test::More tests => 2;
-use Locale::Msgfmt;
-use File::Spec;
+use File::Spec ();
+use Locale::Msgfmt ();
sub slurp {
- open F, File::Spec->catfile(@_);
- my @str = <F>;
- my $str = join "", @str;
- close F;
- return wantarray ? @str : $str;
+ my $file = File::Spec->catfile(@_);
+ local *FILE;
+ open( FILE, '<', $file ) or die "open($file): $!";
+ my @str = <FILE>;
+ my $str = join "", @str;
+ close FILE;
+ return wantarray ? @str : $str;
}
-my @all_bin = slurp("bin", "msgfmt.pl");
-my @all_pm = slurp("lib", "Locale", "Msgfmt.pm");
+my @all_bin = slurp("script", "msgfmt.pl");
+my @all_pm = slurp("lib", "Locale", "Msgfmt.pm");
my ($pm, $bin);
-foreach(@all_bin) {
- $_ =~ /^use Locale::Msgfmt (.*);$/;
- $bin = $1 if($1);
+foreach( @all_bin ) {
+ $_ =~ /^use Locale::Msgfmt (.*);$/;
+ $bin = $1 if($1);
}
-foreach(@all_pm) {
- $_ =~ /^our \$VERSION = '(.*)';$/;
- $pm = $1 if($1);
+foreach( @all_pm ) {
+ $_ =~ /^our \$VERSION = '(.*)';$/;
+ $pm = $1 if($1);
}
-is($pm, $Locale::Msgfmt::VERSION);
-is($bin, $pm);
+is( $pm, $Locale::Msgfmt::VERSION );
+is( $bin, $pm );
More information about the Pkg-perl-cvs-commits
mailing list