Finish the xfpt fix.
authorPhil Pennock <pdp@exim.org>
Thu, 3 Oct 2013 20:13:52 +0000 (16:13 -0400)
committerTodd Lyons <tlyons@exim.org>
Thu, 3 Oct 2013 23:26:38 +0000 (16:26 -0700)
The readers of the version expect no surrounding whitespace; putting the
content in-place requires macro expansion, which requires that .literal
mode be `layout` or `off`, but either of those will escape the XML angle
brackets.  The easiest fix is to generate the XML as part of the macro
definition.

Moved local_params rules out of Makefile and into GenLocalParams

doc/doc-docbook/GenLocalParams [new file with mode: 0755]
doc/doc-docbook/Makefile
doc/doc-docbook/spec.xfpt

diff --git a/doc/doc-docbook/GenLocalParams b/doc/doc-docbook/GenLocalParams
new file mode 100755 (executable)
index 0000000..1408908
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh -eu
+
+output="${1:-local_params}"
+: ${EXIM_VER:?Need the EXIM_VER environment variable}
+
+nicedate="$(date +"%d %b %Y")"
+
+exec > "$output"
+cat <<EOTEMPLATE
+.macro version
+${EXIM_VER}
+.endmacro
+.macro fulldate
+${nicedate}
+.endmacro
+.macro year
+$(date +%Y)
+.endmacro
+.macro versiondatexml
+<revnumber>${EXIM_VER}</revnumber>
+<date>${nicedate}</date>
+.endmacro
+EOTEMPLATE
index 07eb322fa3003e7778fa17b1bdc106ffacf34a33..14bea8e6bb059d9a741e32829fb05257212b82fc 100644 (file)
@@ -25,16 +25,7 @@ exim.8:       spec.xml x2man
 
 .PHONY: local_params
 local_params:
-       echo .macro version > $@
-       echo $(EXIM_VER)        >> $@
-       echo .endmacro          >> $@
-       echo .macro fulldate    >> $@
-       date "+%d %b %Y"        >> $@
-       echo .endmacro          >> $@
-       echo .macro year        >> $@
-       date "+%Y"              >> $@
-       echo .endmacro          >> $@
-
+       ./GenLocalParams $@
 
 ############################### FILTER #################################
 
index 7ab482c3c54a883908bb1333c75187186a97c1bd..9ec45a4ebd3eb176ad0fdeb844c9f81e518d76ac 100644 (file)
 <author><firstname>Exim</firstname><surname>Maintainers</surname></author>
 <authorinitials>EM</authorinitials>
 <revhistory><revision>
-  <revnumber>
-.version
-  </revnumber>
-  <date>
-.fulldate
-  </date>
+.versiondatexml
   <authorinitials>EM</authorinitials>
 </revision></revhistory>
 <copyright><year>