[PATCH 1 of 3] doc/Makefile: detect rst2man errors

Mads Kiilerich mads at kiilerich.com
Thu Aug 20 17:25:21 CDT 2009


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1250804137 -7200
# Node ID aefe772ff3521a6648e199aa8e5565388e34dc80
# Parent  2484868cffde3893e3fafb8e515d396346b87e17
doc/Makefile: detect rst2man errors

Make couldn't detect rst2man errors when it wasn't the last command, so empty
man page files would be installed.

diff --git a/doc/Makefile b/doc/Makefile
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -21,11 +21,13 @@
 	${PYTHON} gendoc.py > $@
 
 %: %.txt common.txt
+	$(RST2MAN) $*.txt > $*.tmp
 	# add newline after all literal blocks and fix backslash escape
-	$(RST2MAN) $*.txt \
-	  | sed -e 's/^\.fi$$/.fi\n/' \
-	  | sed -e 's/\\fB\\\\fP/\\fB\\e\\fP/' \
-	  > $*
+	sed \
+	  -e 's/^\.fi$$/.fi\n/' \
+	  -e 's/\\fB\\\\fP/\\fB\\e\\fP/' \
+	  $*.tmp > $*
+	rm $*.tmp
 
 %.html: %.txt common.txt
 	$(RST2HTML) $*.txt > $*.html


More information about the Mercurial-devel mailing list