diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2020-05-15 16:46:23 +0300 |
---|---|---|
committer | Hannu Nyman <hannu.nyman@iki.fi> | 2020-05-15 16:46:23 +0300 |
commit | da7c3d920274f50f9872103f9aa4cf2a283b3d11 (patch) | |
tree | 71e5ae0e1fd84c8fb8cd73bfd9c57c6ff7994536 /build/i18n-merge-master.pl | |
parent | a7d1e257aa6c3582b168f2e3c4969a5328574152 (diff) |
build/i18n-merge-master: ignore apps deleted in master
Refine the code to ignore apps that have been deleted from master
but still exist in release branches. E.g. luci-app-samba
Previously the unhandled git error from non-existing master
mangled the .po files in the release branch: the 18n header was
removed and all non-ASCII chars were deleted from translation.
Fix this by processing only those files where 'git show' succeeds.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit e4baee8d25 in openwrt-19.07)
Diffstat (limited to 'build/i18n-merge-master.pl')
-rwxr-xr-x | build/i18n-merge-master.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/build/i18n-merge-master.pl b/build/i18n-merge-master.pl index d7479efb8..be0474da9 100755 --- a/build/i18n-merge-master.pl +++ b/build/i18n-merge-master.pl @@ -7,9 +7,14 @@ if (open F, '-|', 'find', $ARGV[0] || '.', '-type', 'f', '-name', '*.po') { (my $ref = $path) =~ s/\.po$/\.master.po/; printf 'Updating %s ', $path; - system("git show --format=\%B 'master:$path' > '$ref'"); - system('msgmerge', '-N', '-o', $path, $ref, $path); - system('msgattrib', '--no-obsolete', '-o', $path, $path); + 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"; + } unlink($ref); } |