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
--- /dev/null
+#!/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
.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 #################################
<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>