From 0d525a3e9366f744edeb327fec94928305b27cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 7 May 2020 14:59:24 +0200 Subject: [PATCH] man: add specifiers section to directives index The hack with getparent().txt is not very pretty, but the whole thing seems to work well enough. It is useful to figure out whihc specifiers are supported where. --- man/directives-template.xml | 8 ++++++++ man/systemd.dnssd.xml | 2 +- man/systemd.unit.xml | 8 +++++--- man/sysusers.d.xml | 2 +- man/tmpfiles.d.xml | 2 +- tools/make-directive-index.py | 9 +++++++++ 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/man/directives-template.xml b/man/directives-template.xml index 3583db3ef0..5ab0beb4cf 100644 --- a/man/directives-template.xml +++ b/man/directives-template.xml @@ -135,6 +135,14 @@ + + Specifiers + + Short strings which are substituted in configuration directives. + + + + Files and directories diff --git a/man/systemd.dnssd.xml b/man/systemd.dnssd.xml index 9e11677bde..2fb0a8ee70 100644 --- a/man/systemd.dnssd.xml +++ b/man/systemd.dnssd.xml @@ -75,7 +75,7 @@ An instance name of the network service as defined in the section 4.1.1 of RFC 6763, e.g. webserver. The option supports simple specifier expansion. The following expansions are understood: - +
Specifiers available diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 999a13c560..dd6d6af21d 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1695,7 +1695,7 @@ and resolvable for the setting to be valid. The following specifiers are understood: -
+
Specifiers available in unit files @@ -1710,7 +1710,8 @@ - + %a Architecture A short string identifying the architecture of the local system. A string such as x86, x86-64 or arm64. See the architectures defined for ConditionArchitecture= above for a full list. @@ -1740,7 +1741,8 @@ Note that this setting is not influenced by the User= setting configurable in the [Service] section of the service unit. - + %H Host name The hostname of the running system at the point in time the unit configuration is loaded. diff --git a/man/sysusers.d.xml b/man/sysusers.d.xml index 46e860ee50..5a71d911c4 100644 --- a/man/sysusers.d.xml +++ b/man/sysusers.d.xml @@ -237,7 +237,7 @@ r - 500-900 Specifiers can be used in the "Name", "ID", "GECOS", "Home directory", and "Shell" fields. An unknown or unresolvable specifier is treated as invalid configuration. The following expansions are understood: -
+
Specifiers available diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index f45dfe0a53..2e9ba5fe90 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -618,7 +618,7 @@ w- /proc/sys/vm/swappiness - - - - 10 Specifiers can be used in the "path" and "argument" fields. An unknown or unresolvable specifier is treated as invalid configuration. The following expansions are understood: -
+
Specifiers available diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py index 26561a2456..c6b2173b2e 100755 --- a/tools/make-directive-index.py +++ b/tools/make-directive-index.py @@ -87,6 +87,15 @@ def _extract_directives(directive_groups, formatting, page): storfile[name.text].append((pagename, section)) formatting[name.text] = name + storfile = directive_groups['specifiers'] + for name in t.iterfind(".//table[@class='specifiers']//entry/literal"): + if name.text[0] != '%' or name.getparent().text is not None: + continue + if name.attrib.get('index') == 'false': + continue + storfile[name.text].append((pagename, section)) + formatting[name.text] = name + def _make_section(template, name, directives, formatting): varlist = template.find(".//*[@id='{}']".format(name)) for varname, manpages in sorted(directives.items()):