[Po4a-devel][CVS] po4a Makefile,1.4,1.5
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv8057
Modified Files:
Makefile
Log Message:
Remove useless request to regenerate META.yml, ./Build build does it alone
Index: Makefile
===================================================================
RCS file: /cvsroot/po4a/po4a/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Makefile 16 Jul 2004 20:02:34 -0000 1.4
+++ Makefile 16 Jul 2004 23:16:23 -0000 1.5
@@ -11,7 +11,6 @@
@./Build realclean
dist: Build
- ./Build distmeta # regenerates META.yml
@./Build dist
stats: Build
20 years, 4 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a TransTractor.pm,1.21,1.22
by Martin Quinson
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv7982/lib/Locale/Po4a
Modified Files:
TransTractor.pm
Log Message:
Bump version number
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- TransTractor.pm 16 Jul 2004 04:11:18 -0000 1.21
+++ TransTractor.pm 16 Jul 2004 23:15:15 -0000 1.22
@@ -10,7 +10,7 @@
use subs qw(makespace);
use vars qw($VERSION @ISA @EXPORT);
-$VERSION="0.17";
+$VERSION="0.17.1";
@ISA = ();
@EXPORT = qw(process translate
read write readpo writepo
20 years, 4 months
[Po4a-devel][CVS] po4a po4a-translate,1.21,1.22
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv7709
Modified Files:
po4a-translate
Log Message:
Rephrase error messages; avoid displaying the same info twice
Index: po4a-translate
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-translate,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- po4a-translate 25 May 2004 19:19:32 -0000 1.21
+++ po4a-translate 16 Jul 2004 23:14:12 -0000 1.22
@@ -231,19 +231,19 @@
print STDERR sprintf(gettext("%s is %s%% translated (%s of %s strings)"),
$master_filename,$percent,$hit,$queries)."\n"
- if $verbose;
+ if $verbose && ($percent>=$threshold);
if ($percent<$threshold) {
- print STDERR sprintf(gettext("ERROR: translation of %s discarded: only %s%% are translated ; %s%% is needed to keep translations."),
+ print STDERR sprintf(gettext("Discard the translation of %s (only %s%% translated; need %s%%)."),
$master_filename,$percent,$threshold)."\n";
unlink($outfile) if (-e $outfile);
} else {
foreach (@addfiles) {
unless ($error) {
$error ||= !$doc->addendum($_);
- die sprintf(gettext("ERROR: file %s couldn't be added to %s.\n This translation is therefore discarded."),
- $_,$master_filename)."\n"
+ die sprintf(gettext("Discard the translation of %s (addendum %s does not apply)."),
+ $master_filename,$_)."\n"
if $error;
}
}
20 years, 4 months
[Po4a-devel][CVS] po4a po4a,1.1,1.2
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv7659
Modified Files:
po4a
Log Message:
Fix a typo
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- po4a 16 Jul 2004 04:08:03 -0000 1.1
+++ po4a 16 Jul 2004 23:13:06 -0000 1.2
@@ -14,7 +14,7 @@
=head1 NAME
-po4a - Update both the po files and translated documents in one shoot
+po4a - Update both the po files and translated documents in one shot
=head1 SYNOPSIS
20 years, 4 months
[Po4a-devel][CVS] po4a Build.PL,1.3,1.4
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv7608
Modified Files:
Build.PL
Log Message:
Major cleanup (reduce indentation; change most shell chunks to perl counterparts; Usefull messages)
Index: Build.PL
===================================================================
RCS file: /cvsroot/po4a/po4a/Build.PL,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Build.PL 16 Jul 2004 20:18:02 -0000 1.3
+++ Build.PL 16 Jul 2004 23:11:54 -0000 1.4
@@ -1,214 +1,250 @@
#!/usr/bin/perl
use Module::Build;
+use strict;
+use warnings;
my $builder = Module::Build->subclass
(
- class => 'My::Builder',
- code => q{
- sub ACTION_build {
- my $self = shift;
- $self->depends_on('code');
- $self->depends_on('docs');
- $self->depends_on('test');
- $self->depends_on('distmeta');
- $self->depends_on('po');
- $self->depends_on('man');
- }
- sub ACTION_po {
- my $self = shift;
-
- #update pot
- my @files = (keys(%{$self->script_files()}), @{$self->rscan_dir('lib',qr{\.pm$})});
- if (!$self->up_to_date(\@files, "po/bin/po4a.pot")) {
- my $podfiles = "../../".join(" ../../",@files);
- $self->do_system("cd po/bin; xgettext -L Perl $podfiles -o po4a.pot.new") || die;
- if ($self->do_system("[ -e po/bin/po4a.pot ]")) {
- $diff = `diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/po4a.pot po/bin/po4a.pot.new 2> /dev/null`;
- if ( $diff eq "" ) {
- `rm -f po/bin/po4a.pot.new; touch po/bin/po4a.pot`;
- } else {
- `mv -f po/bin/po4a.pot.new po/bin/po4a.pot`;
- }
- } else {
- `mv -f po/bin/po4a.pot.new po/bin/po4a.pot`;
- }
- }
-
- #update languages
- @files = @{$self->rscan_dir('po/bin',qr{\.po$})};
- foreach (@files) {
- $_ =~ /.*\/(.*)\.po$/;
- my $lang = $1;
-
- if (!$self->up_to_date("po/bin/po4a.pot","po/bin/$lang.po")) {
- $self->do_system("msgmerge po/bin/$lang.po po/bin/po4a.pot -o po/bin/$lang.po.new");
- }
- # Typically all that changes was a date. I'd
- # prefer not to cvs commit such changes, so
- # detect and ignore them.
- $diff = `diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/$lang.po po/bin/$lang.po.new 2> /dev/null`;
- if ( $diff eq "" ) {
- `rm -f po/bin/$lang.po.new;`;
- } else {
- `mv -f po/bin/$lang.po.new po/bin/$lang.po`;
- `msgfmt --statistics po/bin/$lang.po`;
- }
- if (!$self->up_to_date("po/bin/$lang.po","blib/po/$lang/LC_MESSAGES/po4a.mo")) {
- `mkdir -p blib/po/$lang/LC_MESSAGES`;
- $self->do_system("msgfmt -o blib/po/$lang/LC_MESSAGES/po4a.mo po/bin/$lang.po");
- }
- }
+ class => 'My::Builder',
+ code => q{
+ sub ACTION_build {
+ my $self = shift;
+ $self->depends_on('code');
+ $self->depends_on('docs');
+ $self->depends_on('distmeta'); # regenerate META.yml
+ $self->depends_on('man');
+ $self->depends_on('postats');
+ }
+ sub ACTION_install {
+ my $self = shift;
+
+ require ExtUtils::Install;
+# $self->depends_on('build');
+
+ ExtUtils::Install::install($self->install_map, 1, 0, $self->{args}{uninst}||0);
+ }
+ sub ACTION_binpo {
+ my $self = shift;
+
+ my @files = (keys(%{$self->script_files()}), @{$self->rscan_dir('lib',qr{\.pm$})});
+
+ unless ($self->up_to_date(\@files, "po/bin/po4a.pot")) {
+ print "XX Update po/bin/po4a.pot\n";
+ my $podfiles = join ("", map {" ../../".$_ } @files);
+ system("cd po/bin; xgettext -L Perl $podfiles -o po4a.pot.new") && die;
+ if ( -e "po/bin/po4a.pot") {
+ $diff = qx(diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/po4a.pot po/bin/po4a.pot.new);
+ if ( $diff eq "" ) {
+ unlink "po/bin/po4a.pot.new" || die;
+ # touch it
+ my ($atime, $mtime) = (time,time);
+ utime $atime, $mtime, "po/bin/po4a.pot";
+ } else {
+ rename "po/bin/po4a.pot.new", "po/bin/po4a.pot" || die;
+ }
+ } else {
+ rename "po/bin/po4a.pot.new", "po/bin/po4a.pot" || die;
}
- sub ACTION_manpo {
- my $self = shift;
-
- #update pot
- my @files = (keys(%{$self->script_files()}), @{$self->rscan_dir('lib',qr{\.pm$})}, @{$self->rscan_dir('doc',qr{\.pod$})});
- if (!$self->up_to_date(\@files, "po/pod/po4a-pod.pot")) {
- my $podfiles = "-m ../../".join(" -m ../../",@files);
- $self->do_system("cd po/pod; PERL5LIB=../../lib perl ../../po4a-updatepo -f pod $podfiles -p po4a-pod.pot") || die;
- }
-
- #update languages
- @files = @{$self->rscan_dir('po/pod',qr{\.po$})};
- foreach (@files) {
- $_ =~ /.*\/(.*)\.po$/;
- my $lang = $1;
+ } else {
+ print "XX po/bin/po4a.pot uptodate.\n";
+ }
- if (!$self->up_to_date("po/pod/po4a-pod.pot","po/pod/$lang.po")) {
- $self->do_system("msgmerge po/pod/$lang.po po/pod/po4a-pod.pot -o po/pod/$lang.po.new");
- }
- # Typically all that changes was a date. I'd
- # prefer not to cvs commit such changes, so
- # detect and ignore them.
- $diff = `diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/pod/$lang.po po/pod/$lang.po.new 2> /dev/null`;
- if ( $diff eq "" ) {
- `rm -f po/pod/$lang.po.new;`;
- } else {
- `mv -f po/pod/$lang.po.new po/pod/$lang.po`;
- `msgfmt --statistics po/pod/$lang.po`;
- }
- }
+ # update languages
+ @files = @{$self->rscan_dir('po/bin',qr{\.po$})};
+ foreach (@files) {
+ $_ =~ /.*\/(.*)\.po$/;
+ my $lang = $1;
+
+ unless ($self->up_to_date("po/bin/po4a.pot","po/bin/$lang.po")) {
+ print "XX Sync po/bin/$lang.po: ";
+ system("msgmerge po/bin/$lang.po po/bin/po4a.pot -o po/bin/$lang.po.new") && die;
+ # Typically all that changes was a date. I'd
+ # prefer not to cvs commit such changes, so
+ # detect and ignore them.
+ $diff = qx(diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/$lang.po po/bin/$lang.po.new);
+ if ($diff eq "") {
+ unlink "po/bin/$lang.po.new" || die;
+ # touch it
+ my ($atime, $mtime) = (time,time);
+ utime $atime, $mtime, "po/bin/$lang.po";
+ } else {
+ rename "po/bin/$lang.po.new", "po/bin/$lang.po" || die;
+ }
+ unless ($self->up_to_date("po/bin/$lang.po","blib/po/$lang/LC_MESSAGES/po4a.mo")) {
+ system("mkdir -p blib/po/$lang/LC_MESSAGES") && die;
+ system("msgfmt -o blib/po/$lang/LC_MESSAGES/po4a.mo po/bin/$lang.po") && die;
+ }
+ } else {
+ print "XX po/bin/$lang.po uptodate.\n";
}
- sub ACTION_man {
- my $self = shift;
-
- $self->depends_on('manpo');
- use Pod::Man;
-
- #get the languages
- my @langs = @{$self->rscan_dir('po/pod',qr{\.po$})};
- my $i=0;
- while ($i < @langs) {
- $langs[$i] =~ /.*\/(.*)\.po$/;
- $langs[$i] = $1;
- $i++;
- }
-
- `rm -rf blib/man`;
- `mkdir -p blib/man`;
-
- #Translate binaries manpages
- my $parser = Pod::Man->new (release => "Po4a Tools",
- center => "Po4a Tools", section => 1);
-
- foreach $file (keys(%{$self->script_files()})) {
- foreach $lang (@langs) {
- `PERL5LIB=lib perl po4a-translate -f pod -v -m $file -p po/pod/$lang.po -l blib/man/$file`;
- if ($self->do_system("[ -e blib/man/$file ]")) {
- `mkdir -p blib/man/$lang/man1`;
- $parser->parse_from_file ("blib/man/$file", "blib/man/$lang/man1/$file.1");
- `gzip -9 blib/man/$lang/man1/$file.1`;
- `rm -f blib/man/$file`;
- }
- }
- }
-
- #Translate modules manpages
- $parser = Pod::Man->new (release => "Po4a Tools",
- center => "Po4a Tools", section => 3);
-
- foreach $file (@{$self->rscan_dir('lib',qr{\.pm$})}) {
- $file =~ /.*\/(.*)\.pm$/;
- my $filename = $1;
- foreach $lang (@langs) {
- `PERL5LIB=lib perl po4a-translate -f pod -v -m $file -p po/pod/$lang.po -l blib/man/$filename`;
- if ($self->do_system("[ -e blib/man/$filename ]")) {
- `mkdir -p blib/man/$lang/man3`;
- $parser->parse_from_file ("blib/man/$filename", "blib/man/$lang/man3/Locale::Po4a::$filename.3pm");
- `gzip -9 blib/man/$lang/man3/Locale::Po4a::$filename.3pm`;
- `rm -f blib/man/$filename`;
- }
- }
- }
+ }
- #Translate docs manpages
- $parser = Pod::Man->new (release => "Po4a Tools",
- center => "Po4a Tools", section => 7);
+ }
+ sub ACTION_manpo {
+ my $self = shift;
+
+ # update pot
+ my @files = (keys(%{$self->script_files()}), @{$self->rscan_dir('lib',qr{\.pm$})}, @{$self->rscan_dir('doc',qr{\.pod$})});
+ unless ($self->up_to_date(\@files, "po/pod/po4a-pod.pot")) {
+ my $podfiles = join ("", map {" -m ../../".$_ } @files);
+ print "XX Update documentation pot files: ";
+ system("cd po/pod; PERL5LIB=../../lib perl ../../po4a-updatepo -f pod $podfiles -p po4a-pod.pot")
+ && die;
+ my ($atime, $mtime) = (time,time);
+ utime $atime, $mtime, "po/pod/po4a-pod.pot";
+
+ } else {
+ print "XX Documentation pot file uptodate.\n";
+ }
+
+ # update languages
+ @files = @{$self->rscan_dir('po/pod',qr{\.po$})};
+ foreach (@files) {
+ $_ =~ /.*\/(.*)\.po$/;
+ my $lang = $1;
+
+ unless ($self->up_to_date("po/pod/po4a-pod.pot","po/pod/$lang.po")) {
+ print "XX Update documentation $lang.po: ";
+
+ system("msgmerge po/pod/$lang.po po/pod/po4a-pod.pot -o po/pod/$lang.po.new")
+ && die;
- foreach $file (@{$self->rscan_dir('doc',qr{\.pod$})}) {
- $file =~ /.*\/(.*)\.pod$/;
- my $filename = $1;
- `mkdir -p blib/man/man7`;
- $parser->parse_from_file ($file, "blib/man/man7/$filename");
- `gzip -9 -f blib/man/man7/$filename`;
- foreach $lang (@langs) {
- `PERL5LIB=lib perl po4a-translate -f pod -v -m $file -p po/pod/$lang.po -l blib/man/$filename`;
- if ($self->do_system("[ -e blib/man/$filename ]")) {
- `mkdir -p blib/man/$lang/man7`;
- $parser->parse_from_file ("blib/man/$filename", "blib/man/$lang/man7/$filename");
- `gzip -9 blib/man/$lang/man7/$filename`;
- `rm -f blib/man/$filename`;
- }
- }
- }
+ # Typically all that changes was a date. I'd
+ # prefer not to cvs commit such changes, so
+ # detect and ignore them.
+ $diff = qx(diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/pod/$lang.po po/pod/$lang.po.new);
+ if ( $diff eq "" ) {
+ unlink "po/pod/$lang.po.new" || die;
+ my ($atime, $mtime) = (time,time);
+ utime $atime, $mtime, "po/pod/$lang.po";
+ } else {
+ rename "po/pod/$lang.po.new", "po/pod/$lang.po" || die;
+ }
+ } else {
+ print "XX Documentation $lang.po uptodate.\n";
}
- sub ACTION_install {
- my $self = shift;
-
- require ExtUtils::Install;
- $self->depends_on('build');
- `gzip -9 -f blib/bindoc/*.1`;
- `gzip -9 -f blib/libdoc/*.3pm`;
-
- ExtUtils::Install::install($self->install_map, 1, 0, $self->{args}{uninst}||0);
+ }
+ }
+ sub ACTION_man {
+ my $self = shift;
+
+ $self->depends_on('manpo');
+ use Pod::Man;
+
+ #get the languages
+ my @langs = @{$self->rscan_dir('po/pod',qr{\.po$})};
+ my $i=0;
+ while ($i < @langs) {
+ $langs[$i] =~ /.*\/(.*)\.po$/;
+ $langs[$i] = $1;
+ $i++;
+ }
+
+ system("rm -rf blib/man") && die;
+ system("mkdir -p blib/man") && die;
+
+ # Translate binaries manpages
+ my $parser = Pod::Man->new (release => "Po4a Tools",
+ center => "Po4a Tools", section => "1p");
+
+ foreach $lang (@langs) {
+ print ("X Translate binary manpages to $lang\n");
+ foreach $file (keys(%{$self->script_files()})) {
+ system("PERL5LIB=lib perl po4a-translate -v -f pod -m $file -p po/pod/$lang.po -l blib/man/$file")
+ && die;
+ if (-e "blib/man/$file") {
+ system("mkdir -p blib/man/$lang/man1") && die;
+ $parser->parse_from_file ("blib/man/$file", "blib/man/$lang/man1/$file.1p");
+ system("gzip -9 blib/man/$lang/man1/$file.1p") && die;
+ system("rm -f blib/man/$file")&& die;
+ }
}
- sub ACTION_postats {
- my $self = shift;
- $self->postats("po/bin");
- $self->postats("po/pod");
+ }
+
+ # Translate modules manpages
+ $parser = Pod::Man->new (release => "Po4a Tools",
+ center => "Po4a Tools", section => "3pm");
+
+ foreach $lang (@langs) {
+ print ("X Translate module manpages to $lang\n");
+ foreach $file (@{$self->rscan_dir('lib',qr{\.pm$})}) {
+ $file =~ /.*\/(.*)\.pm$/;
+ my $filename = $1;
+ system("PERL5LIB=lib perl po4a-translate -v -f pod -m $file -p po/pod/$lang.po -l blib/man/$filename")
+ && die;
+ if (-e "blib/man/$filename") {
+ system ("mkdir -p blib/man/$lang/man3") && die;
+ $parser->parse_from_file ("blib/man/$filename",
+ "blib/man/$lang/man3/Locale::Po4a::$filename.3pm") || die;
+ system ("gzip -9 blib/man/$lang/man3/Locale::Po4a::$filename.3pm")
+ && die "Cannot gzip blib/man/$lang/man3/Locale::Po4a::$filename.3pm";
+ system ("rm -f blib/man/$filename") && die;
+ }
}
- sub postats {
- my ($self,$dir) = (shift,shift);
- my $potsize = `(cd $dir;ls -sh *.pot) | sed -n -e 's/^ *\\\\([^[:blank:]]*\\\\).*\$/\\\\1/p'`;
- $potsize =~ /(.*)/;
- print "$dir (pot: $1)\n";
- my @files = @{$self->rscan_dir($dir,qr{\.po$})};
- foreach (@files) {
- $file = $_;
- $file =~ /.*\/(.*)\.po$/;
- my $lang = $1;
- my $stat = `msgfmt -o /dev/null -c -v --statistics $file 2>&1`;
- print " $lang: $stat";
- }
+ }
+
+ # Translate docs manpages
+ $parser = Pod::Man->new (release => "Po4a Tools",
+ center => "Po4a Tools", section => 7);
+
+ foreach $file (@{$self->rscan_dir('doc',qr{\.pod$})}) {
+ $file =~ /.*\/(.*)\.pod$/;
+ my $filename = $1;
+ print "X Generate the man version of $file\n";
+ system("mkdir -p blib/man/man7") && die;
+ $parser->parse_from_file ($file, "blib/man/man7/$filename");
+ system ("gzip -9 -f blib/man/man7/$filename") && die;
+ foreach $lang (@langs) {
+ print "X Translate $file to $lang\n";
+ system ("PERL5LIB=lib perl po4a-translate -f pod -v -m $file -p po/pod/$lang.po -l blib/man/$filename")
+ && die;
+ if (-e "blib/man/$filename") {
+ `mkdir -p blib/man/$lang/man7`;
+ $parser->parse_from_file ("blib/man/$filename", "blib/man/$lang/man7/$filename");
+ `gzip -9 blib/man/$lang/man7/$filename`;
+ `rm -f blib/man/$filename`;
+ }
}
- },
+ }
+ }
+ sub ACTION_postats {
+ my $self = shift;
+ $self->depends_on('binpo');
+ $self->depends_on('manpo');
+ $self->postats("po/bin");
+ $self->postats("po/pod");
+ }
+ sub postats {
+ my ($self,$dir) = (shift,shift);
+ my $potsize = `(cd $dir;ls -sh *.pot) | sed -n -e 's/^ *\\\\([^[:blank:]]*\\\\).*\$/\\\\1/p'`;
+ $potsize =~ /(.*)/;
+ print "$dir (pot: $1)\n";
+ my @files = @{$self->rscan_dir($dir,qr{\.po$})};
+ foreach (@files) {
+ $file = $_;
+ $file =~ /.*\/(.*)\.po$/;
+ my $lang = $1;
+ my $stat = `msgfmt -o /dev/null -c -v --statistics $file 2>&1`;
+ print " $lang: $stat";
+ }
+ }
+ },
);
my $b = $builder->new
- ( module_name => 'po4a',
- license => 'gpl',
- dist_version_from => 'lib/Locale/Po4a/TransTractor.pm', # finds $VERSION
- requires => {Locale::gettext => '1.01',
- SGMLS => 0},
- script_files => ['po4a-gettextize', 'po4a-updatepo',
- 'po4a-translate', 'po4a-normalize', 'po4a'],
- add_to_cleanup => ['t/tmp','messages.mo',
- 'po/pod/po4a-pod.pot~'],
- install_path => {po => '/usr/share/locale',
- man => '/usr/share/man'},
- dist_abstract => 'Tools for helping translation of documentation',
- dist_author => ['Martin Quinson <martin.quinson(a)tuxfamily.org>',
- 'Denis Barbier <barbier(a)linuxfr.org>']
- )->create_build_script;
+ ( module_name => 'po4a',
+ license => 'gpl',
+ dist_version_from => 'lib/Locale/Po4a/TransTractor.pm', # finds $VERSION
+ requires => {'Locale::gettext' => '1.01',
+ 'SGMLS' => 0},
+ script_files => ['po4a-gettextize', 'po4a-updatepo',
+ 'po4a-translate', 'po4a-normalize', 'po4a'],
+ add_to_cleanup => ['t/tmp','messages.mo',
+ 'po/pod/po4a-pod.pot~'],
+ install_path => {po => '/usr/share/locale',
+ man => '/usr/share/man'},
+ dist_abstract => 'Tools for helping translation of documentation',
+ dist_author => ['Martin Quinson <martin.quinson(a)tuxfamily.org>',
+ 'Denis Barbier <barbier(a)linuxfr.org>']
+ )->create_build_script;
20 years, 4 months
[Po4a-devel][CVS] po4a .cvsignore,1.4,1.5
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv7511
Modified Files:
.cvsignore
Log Message:
Ignore automatically generated files
Index: .cvsignore
===================================================================
RCS file: /cvsroot/po4a/po4a/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- .cvsignore 29 Jun 2004 22:07:46 -0000 1.4
+++ .cvsignore 16 Jul 2004 23:10:24 -0000 1.5
@@ -1,3 +1,5 @@
blib pm_to_blib
mantmp
po4a.log typescript
+META.yml
+Build _build
20 years, 4 months
[Po4a-devel]Perl building system
by Jordi Vilalta
Hi,
I finally had time to work on the unified perl building system. I attach
the changed files. You can now delete po/Makefile, po/bin/Makefile and
po/pod/Makefile. This is all done from the Build.PL script. The main
Makefile (also attached) is only a wrapper for the Build script.
This code needs a big cleanup, but at least it works :)
Now there's a little problem with META.yml:
1) if we leave it on the MANIFEST and don't distribute it, the Build
script complains:
Warning: the following files are missing in your kit:
META.yml
Please inform the author.
2) if we remove it from the MANIFEST, when doing the dist file it says:
$ make dist
*** Did you forget to add META.yml to the MANIFEST?
May we put META.yml back to the CVS or is there a better solution?
Regards,
Jordi Vilalta
20 years, 4 months
[Po4a-devel][CVS] po4a Build.PL,1.2,1.3
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv30454
Modified Files:
Build.PL
Log Message:
New build system from Jordi, do not clean out META.yml [me]
Index: Build.PL
===================================================================
RCS file: /cvsroot/po4a/po4a/Build.PL,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Build.PL 16 Jul 2004 04:08:32 -0000 1.2
+++ Build.PL 16 Jul 2004 20:18:02 -0000 1.3
@@ -1,6 +1,202 @@
+#!/usr/bin/perl
+
use Module::Build;
-Module::Build->new
+my $builder = Module::Build->subclass
+(
+ class => 'My::Builder',
+ code => q{
+ sub ACTION_build {
+ my $self = shift;
+ $self->depends_on('code');
+ $self->depends_on('docs');
+ $self->depends_on('test');
+ $self->depends_on('distmeta');
+ $self->depends_on('po');
+ $self->depends_on('man');
+ }
+ sub ACTION_po {
+ my $self = shift;
+
+ #update pot
+ my @files = (keys(%{$self->script_files()}), @{$self->rscan_dir('lib',qr{\.pm$})});
+ if (!$self->up_to_date(\@files, "po/bin/po4a.pot")) {
+ my $podfiles = "../../".join(" ../../",@files);
+ $self->do_system("cd po/bin; xgettext -L Perl $podfiles -o po4a.pot.new") || die;
+ if ($self->do_system("[ -e po/bin/po4a.pot ]")) {
+ $diff = `diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/po4a.pot po/bin/po4a.pot.new 2> /dev/null`;
+ if ( $diff eq "" ) {
+ `rm -f po/bin/po4a.pot.new; touch po/bin/po4a.pot`;
+ } else {
+ `mv -f po/bin/po4a.pot.new po/bin/po4a.pot`;
+ }
+ } else {
+ `mv -f po/bin/po4a.pot.new po/bin/po4a.pot`;
+ }
+ }
+
+ #update languages
+ @files = @{$self->rscan_dir('po/bin',qr{\.po$})};
+ foreach (@files) {
+ $_ =~ /.*\/(.*)\.po$/;
+ my $lang = $1;
+
+ if (!$self->up_to_date("po/bin/po4a.pot","po/bin/$lang.po")) {
+ $self->do_system("msgmerge po/bin/$lang.po po/bin/po4a.pot -o po/bin/$lang.po.new");
+ }
+ # Typically all that changes was a date. I'd
+ # prefer not to cvs commit such changes, so
+ # detect and ignore them.
+ $diff = `diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/$lang.po po/bin/$lang.po.new 2> /dev/null`;
+ if ( $diff eq "" ) {
+ `rm -f po/bin/$lang.po.new;`;
+ } else {
+ `mv -f po/bin/$lang.po.new po/bin/$lang.po`;
+ `msgfmt --statistics po/bin/$lang.po`;
+ }
+ if (!$self->up_to_date("po/bin/$lang.po","blib/po/$lang/LC_MESSAGES/po4a.mo")) {
+ `mkdir -p blib/po/$lang/LC_MESSAGES`;
+ $self->do_system("msgfmt -o blib/po/$lang/LC_MESSAGES/po4a.mo po/bin/$lang.po");
+ }
+ }
+ }
+ sub ACTION_manpo {
+ my $self = shift;
+
+ #update pot
+ my @files = (keys(%{$self->script_files()}), @{$self->rscan_dir('lib',qr{\.pm$})}, @{$self->rscan_dir('doc',qr{\.pod$})});
+ if (!$self->up_to_date(\@files, "po/pod/po4a-pod.pot")) {
+ my $podfiles = "-m ../../".join(" -m ../../",@files);
+ $self->do_system("cd po/pod; PERL5LIB=../../lib perl ../../po4a-updatepo -f pod $podfiles -p po4a-pod.pot") || die;
+ }
+
+ #update languages
+ @files = @{$self->rscan_dir('po/pod',qr{\.po$})};
+ foreach (@files) {
+ $_ =~ /.*\/(.*)\.po$/;
+ my $lang = $1;
+
+ if (!$self->up_to_date("po/pod/po4a-pod.pot","po/pod/$lang.po")) {
+ $self->do_system("msgmerge po/pod/$lang.po po/pod/po4a-pod.pot -o po/pod/$lang.po.new");
+ }
+ # Typically all that changes was a date. I'd
+ # prefer not to cvs commit such changes, so
+ # detect and ignore them.
+ $diff = `diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/pod/$lang.po po/pod/$lang.po.new 2> /dev/null`;
+ if ( $diff eq "" ) {
+ `rm -f po/pod/$lang.po.new;`;
+ } else {
+ `mv -f po/pod/$lang.po.new po/pod/$lang.po`;
+ `msgfmt --statistics po/pod/$lang.po`;
+ }
+ }
+ }
+ sub ACTION_man {
+ my $self = shift;
+
+ $self->depends_on('manpo');
+ use Pod::Man;
+
+ #get the languages
+ my @langs = @{$self->rscan_dir('po/pod',qr{\.po$})};
+ my $i=0;
+ while ($i < @langs) {
+ $langs[$i] =~ /.*\/(.*)\.po$/;
+ $langs[$i] = $1;
+ $i++;
+ }
+
+ `rm -rf blib/man`;
+ `mkdir -p blib/man`;
+
+ #Translate binaries manpages
+ my $parser = Pod::Man->new (release => "Po4a Tools",
+ center => "Po4a Tools", section => 1);
+
+ foreach $file (keys(%{$self->script_files()})) {
+ foreach $lang (@langs) {
+ `PERL5LIB=lib perl po4a-translate -f pod -v -m $file -p po/pod/$lang.po -l blib/man/$file`;
+ if ($self->do_system("[ -e blib/man/$file ]")) {
+ `mkdir -p blib/man/$lang/man1`;
+ $parser->parse_from_file ("blib/man/$file", "blib/man/$lang/man1/$file.1");
+ `gzip -9 blib/man/$lang/man1/$file.1`;
+ `rm -f blib/man/$file`;
+ }
+ }
+ }
+
+ #Translate modules manpages
+ $parser = Pod::Man->new (release => "Po4a Tools",
+ center => "Po4a Tools", section => 3);
+
+ foreach $file (@{$self->rscan_dir('lib',qr{\.pm$})}) {
+ $file =~ /.*\/(.*)\.pm$/;
+ my $filename = $1;
+ foreach $lang (@langs) {
+ `PERL5LIB=lib perl po4a-translate -f pod -v -m $file -p po/pod/$lang.po -l blib/man/$filename`;
+ if ($self->do_system("[ -e blib/man/$filename ]")) {
+ `mkdir -p blib/man/$lang/man3`;
+ $parser->parse_from_file ("blib/man/$filename", "blib/man/$lang/man3/Locale::Po4a::$filename.3pm");
+ `gzip -9 blib/man/$lang/man3/Locale::Po4a::$filename.3pm`;
+ `rm -f blib/man/$filename`;
+ }
+ }
+ }
+
+ #Translate docs manpages
+ $parser = Pod::Man->new (release => "Po4a Tools",
+ center => "Po4a Tools", section => 7);
+
+ foreach $file (@{$self->rscan_dir('doc',qr{\.pod$})}) {
+ $file =~ /.*\/(.*)\.pod$/;
+ my $filename = $1;
+ `mkdir -p blib/man/man7`;
+ $parser->parse_from_file ($file, "blib/man/man7/$filename");
+ `gzip -9 -f blib/man/man7/$filename`;
+ foreach $lang (@langs) {
+ `PERL5LIB=lib perl po4a-translate -f pod -v -m $file -p po/pod/$lang.po -l blib/man/$filename`;
+ if ($self->do_system("[ -e blib/man/$filename ]")) {
+ `mkdir -p blib/man/$lang/man7`;
+ $parser->parse_from_file ("blib/man/$filename", "blib/man/$lang/man7/$filename");
+ `gzip -9 blib/man/$lang/man7/$filename`;
+ `rm -f blib/man/$filename`;
+ }
+ }
+ }
+ }
+ sub ACTION_install {
+ my $self = shift;
+
+ require ExtUtils::Install;
+ $self->depends_on('build');
+ `gzip -9 -f blib/bindoc/*.1`;
+ `gzip -9 -f blib/libdoc/*.3pm`;
+
+ ExtUtils::Install::install($self->install_map, 1, 0, $self->{args}{uninst}||0);
+ }
+ sub ACTION_postats {
+ my $self = shift;
+ $self->postats("po/bin");
+ $self->postats("po/pod");
+ }
+ sub postats {
+ my ($self,$dir) = (shift,shift);
+ my $potsize = `(cd $dir;ls -sh *.pot) | sed -n -e 's/^ *\\\\([^[:blank:]]*\\\\).*\$/\\\\1/p'`;
+ $potsize =~ /(.*)/;
+ print "$dir (pot: $1)\n";
+ my @files = @{$self->rscan_dir($dir,qr{\.po$})};
+ foreach (@files) {
+ $file = $_;
+ $file =~ /.*\/(.*)\.po$/;
+ my $lang = $1;
+ my $stat = `msgfmt -o /dev/null -c -v --statistics $file 2>&1`;
+ print " $lang: $stat";
+ }
+ }
+ },
+);
+
+my $b = $builder->new
( module_name => 'po4a',
license => 'gpl',
dist_version_from => 'lib/Locale/Po4a/TransTractor.pm', # finds $VERSION
@@ -8,7 +204,10 @@
SGMLS => 0},
script_files => ['po4a-gettextize', 'po4a-updatepo',
'po4a-translate', 'po4a-normalize', 'po4a'],
- add_to_cleanup => ['t/tmp'],
+ add_to_cleanup => ['t/tmp','messages.mo',
+ 'po/pod/po4a-pod.pot~'],
+ install_path => {po => '/usr/share/locale',
+ man => '/usr/share/man'},
dist_abstract => 'Tools for helping translation of documentation',
dist_author => ['Martin Quinson <martin.quinson(a)tuxfamily.org>',
'Denis Barbier <barbier(a)linuxfr.org>']
20 years, 4 months
[Po4a-devel][CVS] po4a Makefile,1.3,1.4
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv11118
Modified Files:
Makefile
Log Message:
Remove all the cruft now placed in Build.pl [Jordi]; regenerate the META.yml before dist [me]
Index: Makefile
===================================================================
RCS file: /cvsroot/po4a/po4a/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile 16 Jul 2004 04:09:40 -0000 1.3
+++ Makefile 16 Jul 2004 20:02:34 -0000 1.4
@@ -1,108 +1,20 @@
-#!/usr/bin/make -f
-# This file is public domain software, originally written by Joey Hess.
-
-bins = po4a po4a-gettextize po4a-updatepo po4a-translate po4a-normalize
-libs = $(basename $(notdir $(wildcard lib/Locale/Po4a/*.pm)))
-docs = $(subst .7.pod,,$(notdir $(wildcard doc/*.pod)))
-langs = $(basename $(notdir $(wildcard po/pod/*.po)))
-
-package = po4a
-
-all: build-stamp po-bin-stamp man-stamp
+all: Build
+ @./Build
Build: Build.PL
- perl Build.PL installdirs=vendor
-
-build-stamp: Build
- ./Build
- ./Build test
- ./Build distmeta #regenerates META.yml
- touch build-stamp
-
-po-bin-stamp:
- @echo Update the locale translations
- $(MAKE) -C po/bin
- touch po-bin-stamp
-
-po-pod-stamp:
- @echo Update the pod translations
- $(MAKE) -C po/pod
- touch po-pod-stamp
-
-man-stamp: po-pod-stamp
- @echo Compile the localized man pages
- -rm -rf mantmp
- mkdir mantmp
-# Woody version of pod2man does not accept the --name option,
-# so input file is temporarily copied.
- for bin in $(bins) ; do \
- for lang in $(langs) ; do \
- if [ -e po/pod/$$bin.$$lang.pod ] ; then \
- mkdir -p mantmp/$$lang/man1; \
- cp po/pod/$$bin.$$lang.pod mantmp/$$bin.pod && \
- pod2man --section=1 --center='Po4a Tools' --release='Po4a Tools' \
- mantmp/$$bin.pod > mantmp/$$lang/man1/$$bin.1; \
- gzip -9 mantmp/$$lang/man1/$$bin.1; \
- rm -f mantmp/$$bin.pod; \
- fi; \
- done; \
- done
- for lib in $(libs) ; do \
- for lang in $(langs) ; do \
- if [ -e po/pod/Locale::Po4a::$$lib.$$lang.pod ] ; then \
- mkdir -p mantmp/$$lang/man3; \
- cp po/pod/Locale::Po4a::$$lib.$$lang.pod mantmp/$$lib.pod && \
- pod2man --section=3pm --center='Po4a Tools' --release='Po4a Tools' \
- mantmp/$$lib.pod > mantmp/$$lang/man3/Locale::Po4a::$$lib.3pm; \
- gzip -9 mantmp/$$lang/man3/Locale::Po4a::$$lib.3pm; \
- rm -f mantmp/$$lib.pod; \
- fi; \
- done; \
- done
- for doc in $(docs) ; do \
- pod2man --section=7 --center='Po4a Tools' --release='Po4a Tools' \
- doc/$$doc.7.pod > mantmp/$$doc.7; \
- gzip -9 mantmp/$$doc.7; \
- for lang in $(langs) ; do \
- if [ -e po/pod/$$doc.$$lang.pod ] ; then \
- mkdir -p mantmp/$$lang/man7; \
- cp po/pod/$$doc.$$lang.pod mantmp/$$doc.pod && \
- pod2man --section=7 --center='Po4a Tools' --release='Po4a Tools' \
- mantmp/$$doc.pod > mantmp/$$lang/man7/$$doc.7; \
- gzip -9 mantmp/$$lang/man7/$$doc.7; \
- rm -f mantmp/$$doc.pod; \
- fi; \
- done; \
- done
- touch man-stamp
-
-clean:
- ./Build realclean || true
- $(MAKE) -C po clean
- find -name '.#*'|xargs rm -f || true
- rm -rf po4a.log
- rm -rf mantmp
- rm -f build-stamp po-bin-stamp po-pod-stamp man-stamp
-
-install: build-install po-install man-install
-
-build-install: build-stamp
- ./Build install destdir=$(DESTDIR)
+ perl Build.PL
-po-install: po-bin-stamp
- $(MAKE) -C po/bin install DESTDIR=$(DESTDIR)
+install: Build
+ @./Build install destdir=$(DESTDIR)
-man-install: man-stamp
- install -d $(DESTDIR)/usr/share/man/man7
- install -m 0644 mantmp/*.7.gz $(DESTDIR)/usr/share/man/man7
- for lang in $(langs); do \
- for dir in `ls mantmp/$$lang`; do \
- install -d $(DESTDIR)/usr/share/man/$$lang/$$dir; \
- install -m 0644 mantmp/$$lang/$$dir/* $(DESTDIR)/usr/share/man/$$lang/$$dir; \
- done \
- done
+clean: Build
+ @./Build realclean
dist: Build
- ./Build dist
+ ./Build distmeta # regenerates META.yml
+ @./Build dist
-.PHONY: build clean install build-install po-install man-install tar
+stats: Build
+ @./Build postats
+
+.PHONY: all install clean dist stats
20 years, 4 months
[Po4a-devel][CVS] po4a MANIFEST,1.11,1.12
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv11074
Modified Files:
MANIFEST
Log Message:
Cleanup; remove po/Makefiles since they are useless now
Index: MANIFEST
===================================================================
RCS file: /cvsroot/po4a/po4a/MANIFEST,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- MANIFEST 16 Jul 2004 04:08:32 -0000 1.11
+++ MANIFEST 16 Jul 2004 20:01:28 -0000 1.12
@@ -6,12 +6,7 @@
README
README.tests
TODO
-# debian/changelog
-# debian/control
-# debian/copyright
-# debian/compat
-# debian/dirs
-# debian/rules
+
doc/addendum.fr
doc/po4a.7.pod
lib/Locale/Po4a/Chooser.pm
@@ -22,19 +17,12 @@
lib/Locale/Po4a/Sgml.pm
lib/Locale/Po4a/Dia.pm
lib/Locale/Po4a/TransTractor.pm
-po/Makefile
-po/bin/Makefile
po/bin/fr.po
po/bin/es.po
po/bin/ca.po
po/bin/po4a.pot
-po/pod/Makefile
po/pod/fr.po
po/pod/po4a-pod.pot
-
-# po/pod/po4a-gettextize.fr.pod Not enough translated for now
-# po/pod/po4a-normalize.fr.pod
-# po/pod/po4a-updatepo.fr.pod
# the binaries
po4a
20 years, 4 months