X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=make-directive-index.py;h=99e7bfaf2856e1500796d7af913ff615d63292e3;hb=c784c5ce777f16ee56086a072dc1466639bc9eff;hp=49d1028edb8778b8187a1451c6611b1815788361;hpb=e1abd3efabb95a30d0702ed1c7c33c57bf898297;p=elogind.git
diff --git a/make-directive-index.py b/make-directive-index.py
old mode 100644
new mode 100755
index 49d1028ed..99e7bfaf2
--- a/make-directive-index.py
+++ b/make-directive-index.py
@@ -1,10 +1,29 @@
-# -*- coding: utf-8 -*-
+# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
+#
+# This file is part of systemd.
+#
+# 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
+# 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 .
+
import sys
import collections
-import xml.etree.ElementTree as tree
+import re
+from xml_helper import *
TEMPLATE = '''\
-
+systemd.directives
@@ -22,7 +41,7 @@ TEMPLATE = '''\
systemd.directives
- 5
+ 7
@@ -39,6 +58,24 @@ TEMPLATE = '''\
+
+ Options on the kernel command line
+
+ Kernel boot options for configuring the behaviour of the
+ systemd process.
+
+
+
+
+
+ Environment variables
+
+ Environment variables understood by the systemd
+ manager and other programs.
+
+
+
+
UDEV directives
@@ -47,30 +84,145 @@ TEMPLATE = '''\
+
+
+ Journal fields
+
+ 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
+
+ Directives for configuring the behaviour of the
+ systemd-bootchart process.
+
+
+
+
+
+ command-line options
+
+ Command-line options accepted by programs in the
+ systemd suite.
+
+
+
+
+
+ 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))
-
-def _make_section(refentry, name, directives):
- varlist = refentry.find(".//*[@id='{}']".format(name))
+ klass = variablelist.attrib.get('class')
+ storvar = directive_groups[klass or 'miscellaneous']
+ #