summaryrefslogtreecommitdiff
path: root/tools/make-man-rules.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-02 20:22:35 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-18 10:04:44 -0400
commit0689f766dca5b83443fe0990846478059244d123 (patch)
tree90061691c2d701aa21306729a9b4a4042ab6e1cf /tools/make-man-rules.py
parent72cdb3e783174dcf9223a49f03e3b0e2ca95ddb8 (diff)
downloadsystemd-0689f766dca5b83443fe0990846478059244d123.tar.gz
build-sys: drop support for generation of Makefile-man.am
Diffstat (limited to 'tools/make-man-rules.py')
-rwxr-xr-xtools/make-man-rules.py71
1 files changed, 4 insertions, 67 deletions
diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py
index e9e39f10af..da94d3eabe 100755
--- a/tools/make-man-rules.py
+++ b/tools/make-man-rules.py
@@ -25,55 +25,11 @@ import os.path
import pprint
from xml_helper import *
-SECTION = '''\
-MANPAGES += \\
- {manpages}
-MANPAGES_ALIAS += \\
- {aliases}
-{rules}
-{htmlrules}
-'''
-
-CONDITIONAL = '''\
-if {conditional}
-''' \
-+ SECTION + \
-'''\
-endif
-'''
-
-HEADER = '''\
-# Do not edit. Generated by make-man-rules.py.
-# To regenerate:
-# 1. Create, update, or remove source .xml files in man/
-# 2. Run 'make update-man-list'
-# 3. Run 'make man' to generate manpages
-#
-# To make a man page conditional on a configure switch add
-# attribute conditional="ENABLE_WHAT" or conditional="WITH_WHAT"
-# to <refentry> element.
-'''
-
-HTML_ALIAS_RULE = '''\
-{}.html: {}.html
- $(html-alias)
-'''
-
-FOOTER = '''\
-
-# Really, do not edit this file.
-
-EXTRA_DIST += \\
- {dist_files}
-'''
-
-meson = False
-
def man(page, number):
- return ('man/' if not meson else '') + '{}.{}'.format(page, number)
+ return '{}.{}'.format(page, number)
def xml(file):
- return ('man/' if not meson else '') + os.path.basename(file)
+ return os.path.basename(file)
def add_rules(rules, name):
xml = xml_parse(name)
@@ -110,21 +66,6 @@ def create_rules(xml_files):
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
-def make_makefile(rules, dist_files):
- return HEADER + '\n'.join(
- (CONDITIONAL if conditional else SECTION).format(
- manpages=mjoin(set(rulegroup.values())),
- aliases=mjoin(k for k,v in rulegroup.items() if k != v),
- 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())
- ) + FOOTER.format(dist_files=mjoin(sorted(dist_files)))
-
MESON_HEADER = '''\
# Do not edit. Generated by make-man-rules.py.
manpages = ['''
@@ -151,14 +92,10 @@ def make_mesonfile(rules, dist_files):
return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER))
if __name__ == '__main__':
- meson = sys.argv[1] == '--meson'
- pages = sys.argv[1+meson:]
+ pages = sys.argv[1:]
rules = create_rules(pages)
dist_files = (xml(file) for file in pages
if not file.endswith(".directives.xml") and
not file.endswith(".index.xml"))
- if meson:
- print(make_mesonfile(rules, dist_files))
- else:
- print(make_makefile(rules, dist_files), end='')
+ print(make_mesonfile(rules, dist_files))