Makefile: intermediate steps work with temporary copy of hg.pot
authorSimon Heimberg <simohe@besonet.ch>
Tue, 05 Nov 2013 09:43:26 +0100
changeset 20080 c845b1a95eed
parent 20079 d4838302305c
child 20081 93f9d11603d8
Makefile: intermediate steps work with temporary copy of hg.pot In case of abortion or a failing step, the target file remains untouched instead of being in an intermediate state.
Makefile
--- a/Makefile	Thu Nov 21 15:08:30 2013 -0600
+++ b/Makefile	Tue Nov 05 09:43:26 2013 +0100
@@ -108,7 +108,7 @@
 	  mercurial/fileset.py mercurial/revset.py \
 	  mercurial/templatefilters.py mercurial/templatekw.py \
 	  mercurial/filemerge.py \
-	  $(DOCFILES) > i18n/hg.pot
+	  $(DOCFILES) > i18n/hg.pot~
         # All strings marked for translation in Mercurial contain
         # ASCII characters only. But some files contain string
         # literals like this '\037\213'. xgettext thinks it has to
@@ -120,8 +120,11 @@
 	  --msgid-bugs-address "<mercurial-devel@selenic.com>" \
 	  --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
 	  --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
-	  -d hg -p i18n -o hg.pot
-	$(PYTHON) i18n/posplit i18n/hg.pot
+	  -d hg -p i18n -o hg.pot~
+	$(PYTHON) i18n/posplit i18n/hg.pot~
+        # The target file is not created before the last step. So it never is in
+        # an intermediate state.
+	mv -f i18n/hg.pot~ i18n/hg.pot
 
 %.po: i18n/hg.pot
         # work on a temporary copy for never having a half completed target