From 3c3e5f4276a893791110b03984735654372aa33a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 10 Feb 2014 10:37:10 +0100 Subject: build-sys: move python helpers to tools directory Note that make-man-rules.py is missing in EXTRA_DIST=, this patch fixes this mistake too. --- Makefile.am | 13 +- make-directive-index.py | 320 ------------------------------------------ make-man-index.py | 136 ------------------ make-man-rules.py | 113 --------------- tools/make-directive-index.py | 320 ++++++++++++++++++++++++++++++++++++++++++ tools/make-man-index.py | 136 ++++++++++++++++++ tools/make-man-rules.py | 113 +++++++++++++++ tools/xml_helper.py | 41 ++++++ xml_helper.py | 41 ------ 9 files changed, 617 insertions(+), 616 deletions(-) delete mode 100755 make-directive-index.py delete mode 100755 make-man-index.py delete mode 100644 make-man-rules.py create mode 100755 tools/make-directive-index.py create mode 100755 tools/make-man-index.py create mode 100644 tools/make-man-rules.py create mode 100644 tools/xml_helper.py delete mode 100644 xml_helper.py diff --git a/Makefile.am b/Makefile.am index 3730e71dc2..09a827b02f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -610,16 +610,16 @@ XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml) NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES)) SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES)) -update-man-list: make-man-rules.py $(XML_GLOB) +update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB) $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am @echo "Makefile-man.am has been regenerated" -man/systemd.index.xml: make-man-index.py $(NON_INDEX_XML_FILES) +man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES) $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^) -man/systemd.directives.xml: make-directive-index.py $(SOURCE_XML_FILES) +man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py $(SOURCE_XML_FILES) $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^) @@ -641,9 +641,10 @@ EXTRA_DIST += \ $(HTML_FILES) \ $(HTML_ALIAS) \ $(man_MANS) \ - make-man-index.py \ - make-directive-index.py \ - xml_helper.py + tools/make-man-index.py \ + tools/make-directive-index.py \ + tools/make-man-rules.py \ + tools/xml_helper.py # ------------------------------------------------------------------------------ noinst_LTLIBRARIES += \ diff --git a/make-directive-index.py b/make-directive-index.py deleted file mode 100755 index 2ff304fddc..0000000000 --- a/make-directive-index.py +++ /dev/null @@ -1,320 +0,0 @@ -# -*- 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 re -from xml_helper import * -from copy import deepcopy - -TEMPLATE = '''\ - - - - systemd.directives - systemd - - - - Developer - Zbigniew - Jędrzejewski-Szmek - zbyszek@in.waw.pl - - - - - - systemd.directives - 7 - - - - systemd.directives - Index of configuration directives - - - - Unit directives - - Directives for configuring units, used in unit - files. - - - - - - 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 - - Directives for configuring systemd units through the - udev database. - - - - - - Network directives - - Directives for configuring network links through the - net-setup-link udev builtin and networks through - systemd-networkd. - - - - - - 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. - - - - - - 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 - - - -''' - -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') - storvar = directive_groups[klass or 'miscellaneous'] - #