[Po4a-commits] "po4a changelog, 1.196, 1.197 NEWS, 1.23, 1.24 po4a, 1.76, 1.77 po4a-updatepo, 1.40, 1.41"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Apr 29 22:57:30 UTC 2007


Update of /cvsroot/po4a/po4a
In directory alioth:/tmp/cvs-serv21392

Modified Files:
	changelog NEWS po4a po4a-updatepo 
Log Message:
Added options --previous and --msgmerge-opt options.


Index: NEWS
===================================================================
RCS file: /cvsroot/po4a/po4a/NEWS,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- NEWS	18 Apr 2007 08:40:10 -0000	1.23
+++ NEWS	29 Apr 2007 22:57:27 -0000	1.24
@@ -6,10 +6,7 @@
 ** Dependencies
 
   po4a,
-  po4a-updatepo: msgmerge is called with the --previous switch.
-                 Hence, po4a depends on gettext 0.16.
-                 You can remove this switch in po4a and po4a-updatepo if
-                 this version is not available on your system.
+  po4a-updatepo: New option --previous requires gettext 0.16.
 
 ** Bug fixes
 

Index: po4a-updatepo
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-updatepo,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- po4a-updatepo	26 Mar 2007 21:06:48 -0000	1.40
+++ po4a-updatepo	29 Apr 2007 22:57:28 -0000	1.41
@@ -68,6 +68,15 @@
 Specify each option in the 'name=value' format. See the documentation of
 each plugin for more information about the valid options and their meanings.
 
+=item --previous
+
+This option adds '--previous' to the options passed to msgmerge.
+It requires gettext 0.16 or later.
+
+=item msgmerge-opt options
+
+Extra options for msgmerge.
+
 =item -h, --help
 
 Show a short help message.
@@ -138,6 +147,7 @@
 my (@masterfiles, at pofiles);
 my ($help,$help_fmt,$verbose,$debug,$format, at options);
 my $mastchar;
+my ($previous, $msgmerge_opt);
 GetOptions('help|h'      => \$help,
 	   'help-format' => \$help_fmt,
 
@@ -147,7 +157,10 @@
 
 	   'master-charset|M=s' => \$mastchar,
 
-	   'option|o=s'    => \@options,
+	   'option|o=s'  => \@options,
+
+	   'previous'    => \$previous,
+	   'msgmerge-opt=s' => \$msgmerge_opt,
     
 	   'verbose|v'   => \$verbose,
 	   'debug|d'     => \$debug,
@@ -158,6 +171,8 @@
 $help_fmt && Locale::Po4a::Chooser::list(0);
 pod2usage () if scalar @masterfiles < 1 || scalar @pofiles < 1;
 
+$msgmerge_opt .= " --previous" if $previous;
+
 my %options = (
     "verbose" => $verbose,
     "debug" => $debug);
@@ -203,7 +218,8 @@
     if (-e $po_filename) {
 	print STDERR wrap_msg(gettext("Updating %s:"), $po_filename)
 	    if $verbose;
-	system ("msgmerge","--previous","-U",$po_filename,$pot_filename) == 0
+	my $cmd = "msgmerge $msgmerge_opt -U $po_filename $pot_filename";
+	system ($cmd) == 0
 	    or die wrap_msg(gettext("Error while running msgmerge: %s"), $!);
 	system "msgfmt --statistics -v -o /dev/null $po_filename"
 	  if $verbose;

Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- po4a	16 Apr 2007 22:45:54 -0000	1.76
+++ po4a	29 Apr 2007 22:57:27 -0000	1.77
@@ -301,6 +301,15 @@
 Set the copyright holder in the POT header. The default value is
 "Free Software Foundation, Inc."
 
+=item --msgmerge-opt options
+
+Extra options for msgmerge.
+
+=item --previous
+
+This option adds '--previous' to the options passed to msgmerge.
+It requires gettext 0.16 or later.
+
 =back
 
 =head1 SHORTCOMINGS
@@ -376,6 +385,7 @@
     my @verbose = ();
     my @options = ();
     my @variables = ();
+    my $previous;
 
     my %opts = (
         "help"            => 0,
@@ -394,7 +404,8 @@
         "options"         => {"verbose" => 0, "debug" => 0},
         "variables"       => {},
         "copyright-holder"=> undef,
-        "msgid-bugs-address"=> undef
+        "msgid-bugs-address"=> undef,
+        "msgmerge-opt"    => ""
     );
     Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
     GetOptions(
@@ -418,12 +429,15 @@
         'option|o=s'            => \@options,
         'variable=s'            => \@variables,
         'copyright-holder=s'    => \$opts{"copyright-holder"},
-        'msgid-bugs-address=s'  => \$opts{"msgid-bugs-address"}
+        'msgid-bugs-address=s'  => \$opts{"msgid-bugs-address"},
+        'previous'              => \$previous,
+        'msgmerge-opt=s'        => \$opts{"msgmerge-opt"}
     ) or pod2usage();
 
     $opts{"verbose"} = scalar @verbose;
     $opts{"verbose"} = 0 if $opts{"quiet"};
     $opts{"verbose"} ||= 1 if $opts{"debug"};
+    $opts{"msgmerge-opt"} .= " --previous" if $previous;
 
     # options to transmit to the modules
     %{$opts{"options"}} = (
@@ -896,7 +910,8 @@
     if (-e $po_filename{$lang}) {
 	print wrap_msg(gettext("Updating %s:")." ", $po_filename{$lang})
 	    if ($po4a_opts{"verbose"});
-	my $cmd = "msgmerge --previous -U ".$po_filename{$lang}." $pot_filename".
+	my $cmd = "msgmerge -U ".$po_filename{$lang}." $pot_filename ".
+	          $po4a_opts{"msgmerge-opt"}.
 	          (($po4a_opts{"no-backups"}||$po4a_opts{"split"})?
 	           " --backup=none":"");
 	run_cmd($cmd);
@@ -945,8 +960,9 @@
 
             # Update the PO according to the new POT and to the big PO
             # (compendium).
-            $cmd = "msgmerge --previous -U -C ".$po_filename{$lang}.
-                   " --backup=none ".$tmp_file." ".$splitted_pot{$master};
+            $cmd = "msgmerge -U -C ".$po_filename{$lang}.
+                   " --backup=none ".$po4a_opts{"msgmerge-opt"}.
+                   " $tmp_file ".$splitted_pot{$master};
             run_cmd($cmd);
 
             my $dir = dirname($splitted_po{$lang}{$master});

Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/changelog,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -d -r1.196 -r1.197
--- changelog	29 Apr 2007 15:52:12 -0000	1.196
+++ changelog	29 Apr 2007 22:57:27 -0000	1.197
@@ -1,3 +1,9 @@
+2007-04-30  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* po4a, po4a-updatepo: Do not make --previous a default option for
+	msgmerge. Add options --previous and --msgmerge-opt.
+	* NEWS: Documented.
+
 2007-04-29  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* po/bin/fr.po, po/pod/fr.po: Updated French translation.




More information about the Po4a-commits mailing list