From 93f767be12ff83eb37564a84fcb920e62e631ef7 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Thu, 7 Jun 2018 02:09:31 +0100 Subject: Fix up logic bug in touch_translations.pl The original logic was broken and was causing comparisons against the wrong originals for some translated files. This looks like it was being hidden by the lax CVS versioning code underneath, so we never saw the bug previously. Split the code out, correct it and document what it's actually doing now. Fixes a lot of reported errors with git revisions not being found... --- touch_translations.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'touch_translations.pl') diff --git a/touch_translations.pl b/touch_translations.pl index 3f0942f7b18..1a88c0d49a5 100755 --- a/touch_translations.pl +++ b/touch_translations.pl @@ -107,8 +107,18 @@ foreach $lang (@langs) { $original = $transcheck->original(); $maxdelta = $transcheck->maxdelta() if $transcheck->maxdelta(); $mindelta = $transcheck->mindelta() if $transcheck->mindelta(); - - next unless not defined $original or $original eq $arglang; + + # English is the default original language if the header in the + # translated file doesn't specify otherwise + if (!defined $original) { + $original = "english"; + } + + # If the original language in the translated file isn't the + # language we started with here, bail now - it's not interesting + if (! ($original eq $arglang)) { + next; + } $difference = $VCS->count_changes($argfile, $langrev, $origrev); if (!defined $difference) { -- cgit v1.2.3