[Debconf-devel] Bug#1087002: dpkg-preconfigure.8: Some remarks and editorial changes for this man page
Bjarni Ingi Gislason
bjarniig at simnet.is
Thu Nov 7 23:09:11 GMT 2024
Package: debconf
Version: 1.5.87
Severity: minor
Tags: patch
* What led up to the situation?
Checking for defects with
test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z < "man page"
[Use "groff -e ' $' <file>" to find trailing spaces.]
["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).
[The fate of "test-nroff" was decided in groff bug #55941.]
* What was the outcome of this action?
troff: backtrace: '<stdin>':11: macro 'Vb'
troff: backtrace: file '<stdin>':67
troff:<stdin>:67: warning: font name 'CW' is deprecated
* What outcome did you expect instead?
No output (no warnings).
-.-
General remarks and further material, if a diff-file exist, are in the
attachments.
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.11.5-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
debconf depends on no packages.
Versions of packages debconf recommends:
ii apt-utils 2.9.10
ii debconf-i18n 1.5.87
Versions of packages debconf suggests:
pn debconf-doc <none>
pn debconf-kde-helper <none>
pn debconf-utils <none>
pn libgtk3-perl <none>
pn libnet-ldap-perl <none>
pn libterm-readline-gnu-perl <none>
ii perl 5.40.0-6
ii whiptail 0.52.24-2+b1
-- debconf information excluded
-------------- next part --------------
Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)
[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>
The same goes for man pages that are used as an input.
For a style guide use
mandoc -T lint
-.-
So any 'generator' should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
This is just a simple quality control measure.
The 'generator' may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common defects:
Input text line longer than 80 bytes.
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
Not beginning each input sentence on a new line.
Lines should thus be shorter.
See man-pages(7), item 'semantic newline'.
-.-
The difference between the formatted output of the original and patched file
can be seen with:
nroff -mandoc <file1> > <out1>
nroff -mandoc <file2> > <out2>
diff -u <out1> <out2>
and for groff, using
"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - "
instead of 'nroff -mandoc'
Add the option '-t', if the file contains a table.
Read the output of 'diff -u' with 'less -R' or similar.
-.-.
If 'man' (man-db) is used to check the manual for warnings,
the following must be set:
The option "-warnings=w"
The environmental variable:
export MAN_KEEP_STDERR=yes (or any non-empty value)
or
(produce only warnings):
export MANROFFOPT="-ww -b -z"
export MAN_KEEP_STDERR=yes (or any non-empty value)
-.-.
Wrong distance between sentences in the input file.
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
85:Set the lowest priority of questions you are interested in. Any questions
90:Enables terse output mode. This affects only some frontends.
93:Run in apt mode. It will expect to read a set of package filenames from
94:stdin, rather than getting them as parameters. Typically this is used to
-.-.
Add a zero (0) in front of a decimal fraction that begins with a period
(.)
7:.if t .sp .5v
-.-.
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z ":
troff: backtrace: '<stdin>':11: macro 'Vb'
troff: backtrace: file '<stdin>':67
troff:<stdin>:67: warning: font name 'CW' is deprecated
-.-
Additionally:
Macros 'Vb' and 'Ve': adjust from font 'CW' to 'CR' in troff mode.
-------------- next part --------------
--- dpkg-preconfigure.8 2024-11-07 22:37:27.616360081 +0000
+++ dpkg-preconfigure.8.new 2024-11-07 22:56:14.655830916 +0000
@@ -4,17 +4,19 @@
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
-.if t .sp .5v
+.if t .sp 0.5v
.if n .sp
..
.de Vb \" Begin verbatim text
-.ft CW
+.ds prev_font \fP
+.if t .ft CR
.nf
.ne \\$1
..
.de Ve \" End verbatim text
-.ft R
+.if t .ft \\*[prev_font]
.fi
+.rm prev_font
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
@@ -82,17 +84,20 @@ questions.
Select the frontend to use.
.IP "\fB\-p\fR\fIvalue\fR, \fB\-\-priority=\fR\fIvalue\fR" 4
.IX Item "-pvalue, --priority=value"
-Set the lowest priority of questions you are interested in. Any questions
-with a priority below the selected priority will be ignored and their
-default answers will be used.
+Set the lowest priority of questions you are interested in.
+Any questions with a priority below the selected priority will be ignored
+and their default answers will be used.
.IP \fB\-\-terse\fR 4
.IX Item "--terse"
-Enables terse output mode. This affects only some frontends.
+Enables terse output mode.
+This affects only some frontends.
.IP \fB\-\-apt\fR 4
.IX Item "--apt"
-Run in apt mode. It will expect to read a set of package filenames from
-stdin, rather than getting them as parameters. Typically this is used to
-make apt run dpkg-preconfigure on all packages before they are installed.
+Run in apt mode.
+It will expect to read a set of package filenames from stdin,
+rather than getting them as parameters.
+Typically this is used to make apt run dpkg-preconfigure on all packages
+before they are installed.
To do this, add something like this to /etc/apt/apt.conf:
.Sp
.Vb 5
@@ -107,7 +112,7 @@ To do this, add something like this to /
Display usage help.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
-\&\fBdebconf\fR\|(7)
+\fBdebconf\fR\|(7)
.SH AUTHOR
.IX Header "AUTHOR"
Joey Hess <joeyh at debian.org>
More information about the Debconf-devel
mailing list