From: Simon Marchi Date: Thu, 6 Feb 2020 15:06:45 +0000 (-0500) Subject: Fix: generation of man pages with multiple refnames X-Git-Tag: v2.13.0-rc1~533 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=82f9bfc00ed8c55a4a798b1d44bdf46653784c9c;p=lttng-ust.git Fix: generation of man pages with multiple refnames In this proposed patch [1], we're trying to make a man page with two command names in the NAME section, like this: tracef, vtracef - LTTng-UST printf(3)-like interface Doing so causes the intermediary XML (what asciidoc outputs) to contain this: tracef, vtracef LTTng-UST printf(3)-like interface The refname is used by the docbook XSL to determine the output filename. This therefore results in an output file named `tracef,_vtracef.3`, which is not desirable. The problem is in the asciidoc pass, more specifically the part of asciidoc.conf removed by this patch. Is is there to override the `source`, `version` and `manual` fields, but it also inadvertently affects the refname generation. Instead of playing with the asciidoc output template, this patch sets the same `source`, `version` and `manual` attributes on the asciidoc command line. With the present patch applied, the XML output contains: tracef vtracef LTTng-UST printf(3)-like interface The xmlto pass (docbook XML -> man page) then generates two files, `tracef.3` and `vtracef.3`, where `vtracef.3` simply sources `tracef.3` (which is what we want). [1] https://lists.lttng.org/pipermail/lttng-dev/2020-February/029524.html Signed-off-by: Simon Marchi Signed-off-by: Philippe Proulx Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index f562bfd1..14aa4be7 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -58,8 +58,10 @@ xmlto_verbose_0 = @echo " XMLTO " $@; # Tools to execute: ADOC = $(asciidoc_verbose)$(ASCIIDOC) -f $(ASCIIDOC_CONF) -d manpage \ - -a lttng_version="$(PACKAGE_VERSION)" \ - -a lttng_ust_register_timeout="@LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS@" + -a lttng_ust_register_timeout="@LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS@" \ + -a mansource="LTTng" \ + -a manmanual="LTTng Manual" \ + -a manversion="$(PACKAGE_VERSION)" ADOC_DOCBOOK = $(ADOC) -b docbook XTO = $(xmlto_verbose)$(XMLTO) -m $(XSL_FILE) man diff --git a/doc/man/asciidoc.conf b/doc/man/asciidoc.conf index e3c8016d..b3c8709d 100644 --- a/doc/man/asciidoc.conf +++ b/doc/man/asciidoc.conf @@ -57,23 +57,3 @@ ifdef::backend-docbook[] NOT endif::backend-docbook[] endif::doctype-manpage[] - -# configure XML man page header -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[header] -template::[header-declarations] - - -{mantitle} -{manvolnum} -LTTng -{lttng_version} -LTTng Manual - - - {manname} - {manpurpose} - -endif::backend-docbook[] -endif::doctype-manpage[]