@matheusbsbs / matheus-bagliano / commits / f9dae0d3e6
Fork 0

Documentation/Makefile: fix interrupted builds of user-manual.xml

Unlike gcc, asciidoc does not atomically write its output file or delete it when interrupted. If it is interrupted in the middle of writing an XML file, the result will be truncated input for xsltproc. XSLTPROC user-manual.html user-manual.xml:998: parser error : Premature end of data in t Take care of this case by writing to a temporary and renaming it when finished. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Apr 21, 2010 at 20:18 UTC f9dae0d3e63455206c1e1e169c76aca55aeb5d90
1 file changed +6 -2
Documentation/Makefile
+6 -2
@@ -264,7 +264,9 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
264 mv $@+ $@
265
266 user-manual.xml: user-manual.txt user-manual.conf
267 - $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book $<
267 + $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
268 + $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book -o $@+ $< && \
269 + mv $@+ $@
270
271 technical/api-index.txt: technical/api-index-skel.txt \
272 technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
@@ -278,7 +280,9 @@ XSLT = docbook.xsl
280 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
281
282 user-manual.html: user-manual.xml
281 - $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
283 + $(QUIET_XSLTPROC)$(RM) $@+ $@ && \
284 + xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
285 + mv $@+ $@
286
287 git.info: user-manual.texi
288 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi