[exim-cvs] Finish the xfpt fix.

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Exim Git Commits Mailing List
Data:  
Para: exim-cvs
Assunto: [exim-cvs] Finish the xfpt fix.
Gitweb: http://git.exim.org/exim.git/commitdiff/99474a17d13e1aab63584b67abd83973aa9dbabd
Commit:     99474a17d13e1aab63584b67abd83973aa9dbabd
Parent:     a8c3430674ceb70b5dda7dfe7ddf4374196c955d
Author:     Phil Pennock <pdp@???>
AuthorDate: Thu Oct 3 16:13:52 2013 -0400
Committer:  Todd Lyons <tlyons@???>
CommitDate: Thu Oct 3 16:26:38 2013 -0700


    Finish the xfpt fix.


    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 |   23 +++++++++++++++++++++++
 doc/doc-docbook/Makefile       |   11 +----------
 doc/doc-docbook/spec.xfpt      |    7 +------
 3 files changed, 25 insertions(+), 16 deletions(-)


diff --git a/doc/doc-docbook/GenLocalParams b/doc/doc-docbook/GenLocalParams
new file mode 100755
index 0000000..1408908
--- /dev/null
+++ b/doc/doc-docbook/GenLocalParams
@@ -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
diff --git a/doc/doc-docbook/Makefile b/doc/doc-docbook/Makefile
index 07eb322..14bea8e 100644
--- a/doc/doc-docbook/Makefile
+++ b/doc/doc-docbook/Makefile
@@ -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 #################################

diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 7ab482c..9ec45a4 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -179,12 +179,7 @@
<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>