Fix: generation of man pages with multiple refnames
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 6 Feb 2020 15:06:45 +0000 (10:06 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Feb 2020 19:45:38 +0000 (14:45 -0500)
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:

    <refnamediv>
      <refname>tracef, vtracef</refname>
      <refpurpose>LTTng-UST printf(3)-like interface</refpurpose>
    </refnamediv>

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:

    <refnamediv>
        <refname>tracef</refname>
        <refname>vtracef</refname>
        <refpurpose>LTTng-UST printf(3)-like interface</refpurpose>
    </refnamediv>

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 <simon.marchi@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/man/Makefile.am
doc/man/asciidoc.conf

index f562bfd13a666e5c4a12a0a75b2ba171e69b0ae3..14aa4be7c82d9a5a8e679d6c1d9857b62595f7a9 100644 (file)
@@ -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
index e3c8016dc3ff89c7b4d638a7ad00664d9e3005cc..b3c8709d5ead1f2a4f931ef7e0822e121bb0f7c7 100644 (file)
@@ -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]
-<refentry>
-<refmeta>
-<refentrytitle>{mantitle}</refentrytitle>
-<manvolnum>{manvolnum}</manvolnum>
-<refmiscinfo class="source">LTTng</refmiscinfo>
-<refmiscinfo class="version">{lttng_version}</refmiscinfo>
-<refmiscinfo class="manual">LTTng Manual</refmiscinfo>
-</refmeta>
-<refnamediv>
-  <refname>{manname}</refname>
-  <refpurpose>{manpurpose}</refpurpose>
-</refnamediv>
-endif::backend-docbook[]
-endif::doctype-manpage[]
This page took 0.026015 seconds and 4 git commands to generate.