Skip to content

Commit f9dae0d

Browse files
jrngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3d81676 commit f9dae0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Documentation/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
264264
mv $@+ $@
265265

266266
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 $@+ $@
268270

269271
technical/api-index.txt: technical/api-index-skel.txt \
270272
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
@@ -278,7 +280,9 @@ XSLT = docbook.xsl
278280
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
279281

280282
user-manual.html: user-manual.xml
281-
$(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
283+
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
284+
xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
285+
mv $@+ $@
282286

283287
git.info: user-manual.texi
284288
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi

0 commit comments

Comments
 (0)