Makefile: do update on a temporary copy of a po file
authorSimon Heimberg <simohe@besonet.ch>
Tue, 05 Nov 2013 09:43:36 +0100
changeset 19991 ce5d711475a3
parent 19989 c38c3fdc8b93
child 20006 9276014db865
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.
.hgignore
Makefile
--- a/.hgignore	Thu Nov 07 15:24:23 2013 -0600
+++ b/.hgignore	Tue Nov 05 09:43:36 2013 +0100
@@ -1,6 +1,7 @@
 syntax: glob
 
 *.elc
+*.tmp
 *.orig
 *.rej
 *~
--- a/Makefile	Thu Nov 07 15:24:23 2013 -0600
+++ b/Makefile	Tue Nov 05 09:43:36 2013 +0100
@@ -123,7 +123,10 @@
 	$(PYTHON) i18n/posplit i18n/hg.pot
 
 %.po: i18n/hg.pot
-	msgmerge --no-location --update $@ $^
+        # work on a temporary copy for never having a half completed target
+	cp $@ $@.tmp
+	msgmerge --no-location --update $@.tmp $^
+	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 \