X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=make-directive-index.py;h=b43fea0b99e386936da6d32be21c6877504295d9;hp=51d28c4fae71c5f1c6209a927d6c7e430de460c4;hb=79640424059328268b9fb6c5fa8eb777b27a177e;hpb=eeb019b5b5db785feb0666f3238b1240e7f3e42e diff --git a/make-directive-index.py b/make-directive-index.py index 51d28c4fa..b43fea0b9 100755 --- a/make-directive-index.py +++ b/make-directive-index.py @@ -2,7 +2,7 @@ # # This file is part of systemd. # -# Copyright 2012 Zbigniew Jędrzejewski-Szmek +# Copyright 2012-2013 Zbigniew Jędrzejewski-Szmek # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by @@ -19,10 +19,12 @@ import sys import collections -import xml.etree.ElementTree as tree +import re +from xml_helper import * +from copy import deepcopy TEMPLATE = '''\ - + systemd.directives @@ -40,7 +42,7 @@ TEMPLATE = '''\ systemd.directives - 5 + 7 @@ -58,12 +60,21 @@ TEMPLATE = '''\ - System manager directives + Options on the kernel command line - Directives for configuring the behaviour of the + Kernel boot options for configuring the behaviour of the systemd process. - + + + + + Environment variables + + Environment variables understood by the systemd + manager and other programs. + + @@ -76,14 +87,39 @@ TEMPLATE = '''\ - Journal directives + Journal fields - Directives for configuring the behaviour of the - journald process. + Fields in the journal events with a well known meaning. + + PAM configuration directives + + Directives for configuring PAM behaviour. + + + + + + crypttab options + + Options which influence mounted filesystems and + encrypted volumes. + + + + + + System manager directives + + Directives for configuring the behaviour of the + systemd process. + + + + bootchart.conf directives @@ -92,40 +128,153 @@ TEMPLATE = '''\ + + + command-line options + + Command-line options accepted by programs in the + systemd suite. + + + + + + Constants + + Various constant used and/or defined by systemd. + + + + + + Miscellaneous options and directives + + Other configuration elements which don't fit in + any of the above groups. + + + + + + Files and directories + + Paths and file names referred to in the + documentation. + + + + + + Colophon + + ''' -def _extract_directives(directive_groups, page): - t = tree.parse(page) +COLOPHON = '''\ +This index contains {count} entries in {sections} sections, +referring to {pages} individual manual pages. +''' + +def _extract_directives(directive_groups, formatting, page): + t = xml_parse(page) section = t.find('./refmeta/manvolnum').text pagename = t.find('./refmeta/refentrytitle').text + + storopt = directive_groups['options'] for variablelist in t.iterfind('.//variablelist'): - klass = variablelist.attrib.get('class') or 'unit-directives' - stor = directive_groups[klass] - for varname in variablelist.iterfind('./varlistentry/term/varname'): - text = ''.join(varname.text.partition('=')[:2]) - stor[text].append((pagename, section)) + klass = variablelist.attrib.get('class') + storvar = directive_groups[klass or 'miscellaneous'] + #