From 1b90903cb2a60e8ee84dd2bf6f10e3a7aa325cf9 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 21 Dec 2017 03:09:33 +0000 Subject: [PATCH] Postprocessing for crowdin: cleanup PO-Revision-Date: from .po files --- .ci/Jenkinsfile.crowdin | 2 ++ .ci/cleanup-po.pl | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 .ci/cleanup-po.pl diff --git a/.ci/Jenkinsfile.crowdin b/.ci/Jenkinsfile.crowdin index d9020c92..74600b41 100644 --- a/.ci/Jenkinsfile.crowdin +++ b/.ci/Jenkinsfile.crowdin @@ -38,6 +38,8 @@ timestamps { sh "$crowdin_cli download --branch ${upstream_branch}" } } + sh 'find . -name "*.po" -exec msgfilter -i "{}" -o "{}.replacement" .ci/cleanup-po.pl ";"' + sh 'find . -name "*.po" -exec mv "{}.replacement" "{}" ";"' } stage('Push') { sh 'git config user.name "ZNC-Jenkins"' diff --git a/.ci/cleanup-po.pl b/.ci/cleanup-po.pl new file mode 100755 index 00000000..7415b251 --- /dev/null +++ b/.ci/cleanup-po.pl @@ -0,0 +1,16 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use v5.10; + +local $/; +my $text = <>; + +if ($ENV{MSGFILTER_MSGID}) { + print $text; +} else { + for (split(/^/, $text)) { + print unless /^PO-Revision-Date:/; + } +}