From 740c0f147ee0f363fc85af2b0c86cc55634a4c1a Mon Sep 17 00:00:00 2001 From: Richard Mansfield Date: Mon, 20 Feb 2012 15:54:15 +1300 Subject: [PATCH] Fix the check for updated msgids When updating the msgids in an existing po translation, the diff from the existing .po file to the the update-po-from-pot.pl output was only checking lines starting with "[+-]msg", in order to avoid pushing the file every time there was a change to the .po header. This needs to be changed because diffs in help files (and probably to the second and later lines of multi-line translations) don't start with 'msgid'. Instead, attempt to find diffs on lines following the "X-Generator: Launchpad" or "X-Launchpad-Export-Date:" lines (hopefully in the header). --- mahara-langpacks/update-pot.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mahara-langpacks/update-pot.sh b/mahara-langpacks/update-pot.sh index 911623f..e04cb72 100755 --- a/mahara-langpacks/update-pot.sh +++ b/mahara-langpacks/update-pot.sh @@ -148,7 +148,9 @@ for branch in ${branches} ; do # New file bzr add mahara/$pobase else - podiffs=`bzr diff mahara/${pobase} | grep "[+-]msg"` + # There are always a few changes in the po header, but we don't care about them, so just + # check if anything's changed after the "X-Generator:" or "X-Launchpad-Export-Date:" lines + podiffs=`bzr diff mahara/${pobase} | awk '/^[+- ]"(X-Generator: Launchpad|X-Launchpad-Export-Date:)/ {p+=1;next}; p>1 {print}' | grep "^[+-]"` if [ -z "$podiffs" ] ; then # Nothing worth committing bzr revert mahara/$pobase -- GitLab