Bug#1099035: runlevel.8: Some remarks and a patch with editorial changes for this man page

Bjarni Ingi Gislason bjarniig at simnet.is
Thu Feb 27 14:35:44 GMT 2025


Package: sysvinit-core
Version: 3.14-1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"

  [Use "groff -e ' $' -e '\\~$' <file>" to find obvious 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:<stdin>:28: warning: trailing space in the line
troff:<stdin>:31: warning: trailing space in the line
troff:<stdin>:45: warning: trailing space in the line


   * 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.12.12-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)

Versions of packages sysvinit-core depends on:
ii  initscripts     3.14-1
ii  libc6           2.40-7
ii  libselinux1     3.8-3
ii  mount           2.40.4-4
ii  sysv-rc         3.14-1
ii  sysvinit-utils  3.14-1

Versions of packages sysvinit-core recommends:
ii  orphan-sysvinit-scripts  0.17

Versions of packages sysvinit-core suggests:
ii  bootlogd  3.14-1

-- debconf information excluded
-------------- next part --------------
Input file is runlevel.8

Output from "mandoc -T lint  runlevel.8": (shortened list)

      5 whitespace at end of input line

Remove trailing space with: sed -e 's/  *$//'

-.-.

Output from "test-groff -mandoc -t -ww -z runlevel.8": (shortened list)


      3 trailing space in the line

-.-.

Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

Number of lines affected is

5

-.-.

Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.

45:\fBwho -r\fP command. 

-.-.

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.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

N.B.

  The number of lines affected can be too large to be in a patch.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

#!/usr/bin/sh

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

32:separated by a single space. If there is no previous system

-.-.

Use \(en (en-dash) for a dash at the beginning (en) of a line,
or between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

runlevel.8:20:runlevel - find the previous and current system runlevel

-.-.

FSF office address update.  See
https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00004.html

16:.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

-.-.

Trailing space in a macro call.
Remove with "sed -i -e 's/  *$//'"

22:.B runlevel 

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

troff:<stdin>:28: warning: trailing space in the line
troff:<stdin>:31: warning: trailing space in the line
troff:<stdin>:45: warning: trailing space in the line

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
-------------- next part --------------
--- runlevel.8	2025-02-27 14:18:41.330641780 +0000
+++ runlevel.8.new	2025-02-27 14:25:13.593778098 +0000
@@ -17,20 +17,21 @@
 .\"
 .TH RUNLEVEL 8 "May 27, 1997" "sysvinit " "Linux System Administrator's Manual"
 .SH NAME
-runlevel - find the previous and current system runlevel
+runlevel \- find the previous and current system runlevel
 .SH SYNOPSIS
-.B runlevel 
+.B runlevel
 .RI [ utmp ]
 .SH DESCRIPTION
 .B runlevel
 reads the system
 .I utmp
-file (typically 
+file (typically
 .IR /var/run/utmp )
 to locate the runlevel record, and then
-prints the previous and current system runlevel on its standard output, 
-separated by a single space. If there is no previous system
-runlevel, the letter \fBN\fP will be printed instead.
+prints the previous and current system runlevel on its standard output,
+separated by a single space.
+If there is no previous system runlevel,
+the letter \fBN\fP will be printed instead.
 .PP
 If no
 .I utmp
@@ -42,13 +43,13 @@ prints the word \fBunknown\fP and exits
 .PP
 .B Runlevel
 can be used in \fIrc\fP scripts as a substitute for the System-V
-\fBwho -r\fP command. 
+\fBwho \-r\fP command.
 However, in newer versions of \fBinit\fP(8) this information
 is also available in the environment variables \fBRUNLEVEL\fP and
 \fBPREVLEVEL\fP.
 .SH OPTIONS
 .\"{{{ utmp
-.IP \fIutmp\fP 
+.IP \fIutmp\fP
 The name of the \fIutmp\fP file to read.
 .\"}}}
 .SH SEE ALSO
-------------- 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

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

  The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  "git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")

  Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  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 -d -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 from 'diff -d -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)

-.-


More information about the Debian-init-diversity mailing list