[PATCH] Makefile: do update on a temporary copy of a po file

Simon Heimberg simohe at besonet.ch
Tue Nov 5 03:33:12 CST 2013


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1383641016 -3600
#      Tue Nov 05 09:43:36 2013 +0100
# Branch stable
# Node ID 94dec8e6cf107a55354ccd58eb7ba8cd2c4f910c
# Parent  3d8f013071ebf4e134cf1dec71d6a7a5d4fa1397
Makefile: do update on a temporary copy of a po file

This avoids having a half completed file (with a new timestamp) when msgmerge
has failed.

diff -r 3d8f013071eb -r 94dec8e6cf10 Makefile
--- a/Makefile	Tue Nov 05 09:43:26 2013 +0100
+++ b/Makefile	Tue Nov 05 09:43:36 2013 +0100
@@ -126,7 +126,10 @@
 	mv -f i18n/hg.pot~ i18n/hg.pot
 
 %.po: i18n/hg.pot
-	msgmerge --no-location --update $@ $^
+        # work on a temporary copy for never having a half completed target
+	cp $@ $@~
+	msgmerge --no-location --update $@~ $^
+	mv -f $@~ $@
 
 .PHONY: help all local build doc clean install install-bin install-doc \
 	install-home install-home-bin install-home-doc dist dist-notests tests \


More information about the Mercurial-devel mailing list