Skip to content

Commit

Permalink
Documentation/Makefile: fix interrupted builds of user-manual.xml
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Apr 22, 2010
1 parent 3d81676 commit f9dae0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
mv $@+ $@

user-manual.xml: user-manual.txt user-manual.conf
$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book $<
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book -o $@+ $< && \
mv $@+ $@

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

user-manual.html: user-manual.xml
$(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
mv $@+ $@

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

0 comments on commit f9dae0d

Please sign in to comment.