make-man-rules.py revision 56ba3c78ae35065064c4289a0c8e22a81256af20
# -*- 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
SECTION = '''\
MANPAGES += \\
{manpages}
MANPAGES_ALIAS += \\
{aliases}
{rules}
'''
CONDITIONAL = '''\
if {conditional}
''' \
+ SECTION + \
'''\
endif
'''
HEADER = '''\
# Do not edit. Generated by make-man-rules.py.
# Regenerate with 'make update-man-list'.
'''
# print('parsing {}'.format(name), file=sys.stderr)
# print('{} => {} [{}]'.format(alias, target, conditional), file=sys.stderr)
def create_rules(*xml_files):
" {conditional => {alias-name => source-name}} "
return rules
def make_makefile(rules):
if k != v),
if __name__ == '__main__':