chiark / gitweb /
journal: fail silently in sd_j_sendv() if journal is unavailable
[elogind.git] / make-man-rules.py
index b88b43a..ad601f8 100644 (file)
@@ -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 += \\
@@ -28,6 +28,7 @@ MANPAGES += \\
 MANPAGES_ALIAS += \\
        {aliases}
 {rules}
+{htmlrules}
 '''
 
 CONDITIONAL = '''\
@@ -40,15 +41,20 @@ endif
 
 HEADER = '''\
 # Do not edit. Generated by make-man-rules.py.
-# Regenerate with 'make update-man-list'.
+# Regenerate with 'make all update-man-list'.
 
 '''
 
+HTML_ALIAS_RULE = '''\
+{}.html: {}.html
+       $(html-alias)
+'''
+
 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]
@@ -84,6 +90,9 @@ def make_makefile(rules):
             rules='\n'.join('{}: {}'.format(k,v)
                             for k,v in sorted(rulegroup.items())
                             if k != v),
+            htmlrules='\n'.join(HTML_ALIAS_RULE.format(k[:-2],v[:-2])
+                                for k,v in sorted(rulegroup.items())
+                                if k != v),
             conditional=conditional)
         for conditional,rulegroup in sorted(rules.items()))