[Po4a-commits] "po4a po4a,1.36,1.37"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Thu Nov 17 19:27:34 UTC 2005
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv27773
Modified Files:
po4a
Log Message:
Only update the POT is a master document is more recent. [Thomas Huriaux]
First part for closing #339459
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- po4a 16 Nov 2005 19:49:14 -0000 1.36
+++ po4a 17 Nov 2005 19:27:31 -0000 1.37
@@ -508,15 +508,24 @@
unless (length $pot_filename);
# make a big pot
+my $update_pot_file = 0;
if (-e $pot_filename) {
- print wrap_msg(gettext("Updating %s:"), $pot_filename)
- if $po4a_opts{"verbose"};
+ foreach my $master (keys %document) {
+ if (-M $master < -M $pot_filename) {
+ $update_pot_file = 1;
+ print wrap_msg(gettext("Updating %s:"), $pot_filename)
+ if $po4a_opts{"verbose"};
+ last;
+ }
+ }
} else {
print wrap_msg(gettext("Creating %s:"), $pot_filename)
if $po4a_opts{"verbose"};
+ $update_pot_file = 1;
}
my $potfile=Locale::Po4a::Po->new();
+if ($update_pot_file) {
foreach my $master (keys %document) {
my %file_opts = %po4a_opts;
my $options = $document{$master}{"options"}{"global"};
@@ -542,6 +551,7 @@
$potfile->write($pot_filename);
print wrap_msg(gettext(" (%d entries)"), $potfile->count_entries());
+}
# update all po files
my $lang;
More information about the Po4a-commits
mailing list