summaryrefslogtreecommitdiff
path: root/make-man-rules.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-29 14:22:27 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-29 20:30:21 -0400
commit1a13e31d275430ffba713c8a68ee7f22093c29e0 (patch)
tree66b0b3e91d22fce58affea603c2a5cbf6eb0c6a9 /make-man-rules.py
parent4e7b3c20e00c40372c551bd42c57e40500f4ceb4 (diff)
build-sys,man: use XML entities to substite strings
This makes it easier to add substitutions to man pages, avoiding the separate transformation step. mkdir -p's are removed from the rule, because xsltproc will will create directories on it's own. All in all, two or three forks per man page are avoided, which should make things marginally faster. Unfortunately python parsers must too be tweaked to handle entities. This isn't particularly easy: with lxml a custom Resolver can be used, but the stdlib etree doesn't support external entities *at all*. So when running without lxml, the entities are just removed. Right now it doesn't matter, since the entities are not indexed anyway. But I intend to add indexing of filenames in the near future, and then the index generated without lxml might be missing a few lines. Oh well.
Diffstat (limited to 'make-man-rules.py')
-rw-r--r--make-man-rules.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/make-man-rules.py b/make-man-rules.py
index 46a586374f..ad601f874f 100644
--- a/make-man-rules.py
+++ b/make-man-rules.py
@@ -18,9 +18,9 @@
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
-import xml.etree.ElementTree as tree
import collections
import sys
+from xml_helper import *
SECTION = '''\
MANPAGES += \\
@@ -54,7 +54,7 @@ def man(page, number):
return 'man/{}.{}'.format(page, number)
def add_rules(rules, name):
- xml = tree.parse(name)
+ xml = xml_parse(name)
# print('parsing {}'.format(name), file=sys.stderr)
conditional = xml.getroot().get('conditional') or ''
rulegroup = rules[conditional]