From 01c9c27d45f9b25f8694d10d7d367a0170ddad2f Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Thu, 20 Feb 2025 19:35:21 +0100 Subject: [PATCH] release.pl: fail if transifex doesn't deliver an existing translation --- scripts/release.pl | 2 +- scripts/tsstat.pl | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/release.pl b/scripts/release.pl index 5b77c0c9f3e4..6d2694432788 100755 --- a/scripts/release.pl +++ b/scripts/release.pl @@ -156,7 +156,7 @@ ($$) unless( $skipts ) { print "Pulling transifex translations...\n"; - run( "scripts/pull_ts.sh", "pull_ts.sh failed" ); + run( "CONSIDER_TS_DROP_FATAL=1 scripts/pull_ts.sh", "pull_ts.sh failed" ); run( "git add i18n/*.ts", "adding translations failed" ); run( "git commit -n -a -m \"translation update for $version from transifex\"", "could not commit translation updates" ); } else { diff --git a/scripts/tsstat.pl b/scripts/tsstat.pl index 1e1af7dd1ca3..3e9a214a070e 100755 --- a/scripts/tsstat.pl +++ b/scripts/tsstat.pl @@ -207,8 +207,17 @@ open I, "i18n/CMakeLists.txt.temp"; open O, ">i18n/CMakeLists.txt"; while() { - if( /^SET\(TS_FILES /i ) { - print O "set(TS_FILES " . join( " ", map { "qgis_$_\.ts"; } @ts ) . ")\n"; + if( /^SET\(TS_FILES (.*)\)/i ) { + my @oldts = split /\s+/, $1; + my @newts = map { "qgis_$_\.ts"; } @ts; + for my $ts (@oldts) { + die "FATAL: $ts was dropped\n" if exists $ENV{CONSIDER_TS_DROP_FATAL} && ! grep /^$ts$/, @newts; + print STDERR "WARNING: $ts dropped\n" unless grep /^$ts$/, @newts; + } + for my $ts (@newts) { + print STDERR "INFO: $ts added\n" unless grep /^$ts$/, @oldts; + } + print O "set(TS_FILES " . join( " ", @newts ) . ")\n"; } else { print O; }