Re: [PATCH] Documentation/Makefile: fix interrupted builds of user-manual.xml

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Resend, including the all original recipients. Sorry for the dupe, Jonathan.)

On 2010 Apr 21, at 20:18, Jonathan Nieder wrote:
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@xxxxxxxxx>
---
Based on a true story.


For what it is worth, the changes seem reasonable to me. There may be a few other places that could use the same treatment, though maybe not all the other documentation tools suffer to the same degree as asciidoc.


@@ -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


I suppose it is obvious enough what is going on in this in this second hunk, but there is no mention of this change in the commit message. Is this hunk due to a similar problem with xsltproc? Or maybe this is just "defensive coding"?

--
Chris
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]