2020-01-29 07:29:17 +00:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
if (open F, '-|', 'find', $ARGV[0] || '.', '-type', 'f', '-name', '*.po') {
|
|
|
|
while (defined(my $path = readline F)) {
|
|
|
|
chomp $path;
|
|
|
|
|
|
|
|
(my $ref = $path) =~ s/\.po$/\.master.po/;
|
|
|
|
|
|
|
|
printf 'Updating %s ', $path;
|
2020-05-15 13:46:23 +00:00
|
|
|
my $returnCode = system("git show --format=\%B 'master:$path' > '$ref'");
|
|
|
|
if ( $returnCode == 0 )
|
|
|
|
{
|
|
|
|
system('msgmerge', '-N', '-o', $path, $ref, $path);
|
|
|
|
system('msgattrib', '--no-obsolete', '-o', $path, $path);
|
|
|
|
} else {
|
|
|
|
print "...failed due to git error.\n";
|
|
|
|
}
|
2020-01-29 07:29:17 +00:00
|
|
|
unlink($ref);
|
|
|
|
}
|
|
|
|
|
|
|
|
close F;
|
|
|
|
}
|