make-man-rules.py revision c0652d453e2329fa465f71d4c68f5fe8618a7de2
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2013 Zbigniew Jędrzejewski-Szmek
#
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import collections
import sys
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.
# Regenerate with 'make all update-man-list'.
'''
HTML_ALIAS_RULE = '''\
{}.html: {}.html
$(html-alias)
'''
FOOTER = '''\
EXTRA_DIST += \\
{files}
'''
# print('parsing {}'.format(name), file=sys.stderr)
return
# print('{} => {} [{}]'.format(alias, target, conditional), file=sys.stderr)
def create_rules(xml_files):
" {conditional => {alias-name => source-name}} "
try:
except Exception:
raise
return rules
if k != v),
if k != v),
if __name__ == '__main__':