Package: cpio
Version: 2.15+dfsg-2
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?

an.tmac:<stdin>:39: misuse, warning: .BR is for at least 2 arguments, got 1
        Use macro '.B' for one argument or split argument.


   * 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.17-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 cpio depends on:
ii  libc6  2.41-4

cpio recommends no packages.

Versions of packages cpio suggests:
pn  libarchive-dev  <none>

-- no debconf information
Input file is mt-gnu.1

Output from "mandoc -T lint  mt-gnu.1": (shortened list)

      1 input text line longer than 80 bytes: [\fB\-V\fR] [\fB\-f\...
     14 whitespace at end of input line


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

-.-.

Output from "test-nroff -mandoc -t -ww -z mt-gnu.1": (shortened list)

      1         Use macro '.B' for one argument or split argument.
      1 .BR is for at least 2 arguments, got 1


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

-.-.

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

14

-.-.

Wrong distance (not two spaces) 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.

  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"

125:Perform long erase of tape. If

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.  

Line 21, length 118

[\fB\-V\fR] [\fB\-f\fR \fIdevice\fR] [\fB\-\-file=\fIdevice\fR] 
[\fB\-\-rsh-command=\fIcommand\fR] [\fB\-\-version\fR]

Longest line is number 21 with 118 characters

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".

mt-gnu.1:40:or by a command line option (see below), which also overrides the
mt-gnu.1:127:is 0, perform short erase of tape (some devices do not support 
this).

-.-.

Only one space character after a possible end of sentence
(after a punctuation, that can end a sentence).

mt-gnu.1:125:Perform long erase of tape. If

-.-.

Put a subordinate sentence (after a comma) on a new line.

mt-gnu.1:30:which must be one of the tape operations listed below, on a tape
mt-gnu.1:40:or by a command line option (see below), which also overrides the
mt-gnu.1:45:archive, use a filename that starts with `HOSTNAME:'.  The
mt-gnu.1:47:tape drive as that user, if you have permission to do so (typically 
an
mt-gnu.1:51:accepted.  Not all operations are available on all systems, or work 
on
mt-gnu.1:53:Some operations optionally take a repeat count, which can be given
mt-gnu.1:115:Rewind the tape and, if applicable, unload the tape.
mt-gnu.1:121:Rewind the tape, then wind it to the end of the reel,
mt-gnu.1:127:is 0, perform short erase of tape (some devices do not support 
this).
mt-gnu.1:130:exits with a status of 0 if the operation succeeded, 1 if the
mt-gnu.1:131:operation or device name given was invalid, or 2 if the operation
mt-gnu.1:140:tape drive on another machine, use a filename that
mt-gnu.1:142:username and an `@' to access the remote tape drive as that user, 
if
mt-gnu.1:162:Copyright \(co 2014 Free Software Foundation, Inc.

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

mt-gnu.1:16:.TH MT 1 "January 28, 2014" "MT" "GNU CPIO"

-.-.

Space character after a macro call.

60:.TP 
66:.TP 
72:.TP 
77:.TP 
82:.TP 
89:.TP 
96:.TP 
102:.TP 
106:.TP 
110:.TP 
113:.TP 
116:.TP 
119:.TP 
123:.TP 

-.-.

Section headings (.SH and .SS) do not need quoting their arguments.

159:.SH "BUG REPORTS"

-.-.

Put a (long) web address on a new line to reduce the posibility of
splitting the address between two output lines.
Or inhibit hyphenation with "\%" in front of the name.


165:License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>

-.-.

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

an.tmac:<stdin>:39: misuse, warning: .BR is for at least 2 arguments, got 1
        Use macro '.B' for one argument or split argument.

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
--- mt-gnu.1    2025-03-20 00:49:24.734274966 +0000
+++ mt-gnu.1.new        2025-03-20 01:08:19.418285584 +0000
@@ -13,13 +13,14 @@
 .\"
 .\" You should have received a copy of the GNU General Public License
 .\" along with GNU cpio.  If not, see <http://www.gnu.org/licenses/>.
-.TH MT 1 "January 28, 2014" "MT" "GNU CPIO"
+.TH MT 1 "January 28, 2014" MT "GNU CPIO"
 .SH NAME
 mt \- control magnetic tape drive operation
 .SH SYNOPSIS
 .B mt
-[\fB\-V\fR] [\fB\-f\fR \fIdevice\fR] [\fB\-\-file=\fIdevice\fR] 
[\fB\-\-rsh-command=\fIcommand\fR] [\fB\-\-version\fR]
-\fIoperation\fR [\fIcount\fR]
+[\fB\-V\fR] [\fB\-f\fR \fIdevice\fR] [\fB\-\-file=\fIdevice\fR]
+[\fB\-\-rsh-command=\fIcommand\fR] [\fB\-\-version\fR] \fIoperation\fR
+[\fIcount\fR]
 .SH DESCRIPTION
 This manual page
 documents the GNU version of
@@ -27,8 +28,8 @@ documents the GNU version of
 .B mt
 performs the given
 .IR operation ,
-which must be one of the tape operations listed below, on a tape
-drive.
+which must be one of the tape operations listed below,
+on a tape drive.
 .PP
 The default tape device to operate on is taken from the file
 .B /usr/include/sys/mtio.h
@@ -36,100 +37,111 @@ when
 .B mt
 is compiled.  It can be overridden by giving a device file name in
 the environment variable
-.BR TAPE
-or by a command line option (see below), which also overrides the
-environment variable.
+.B TAPE
+or by a command line option (see below),
+which also overrides the environment variable.
 .PP
-The device must be either a character special file or a
-remote tape drive.  To use a tape drive on another machine as the
-archive, use a filename that starts with `HOSTNAME:'.  The
-hostname can be preceded by a username and an `@' to access the remote
-tape drive as that user, if you have permission to do so (typically an
-entry in that user's `~/.rhosts' file).
+The device must be either a character special file
+or a remote tape drive.
+To use a tape drive on another machine as the archive,
+use a filename that starts with `HOSTNAME:'.
+The hostname can be preceded by a username
+and an `@' to access the remote tape drive as that user,
+if you have permission to do so
+(typically an entry in that user's `~/.rhosts' file).
 .PP
-The available operations are listed below.  Unique abbreviations are
-accepted.  Not all operations are available on all systems, or work on
-all types of tape drives.
-Some operations optionally take a repeat count, which can be given
-after the operation name and defaults to 1.
+The available operations are listed below.
+Unique abbreviations are accepted.
+Not all operations are available on all systems,
+or work on all types of tape drives.
+Some operations optionally take a repeat count,
+which can be given after the operation name
+and defaults to 1.
 .TP
 .BR eof ", " weof
 Write
 .I count
 EOF marks at current position.
-.TP 
+.TP
 .B fsf
 Forward space
 .I count
 files.
 The tape is positioned on the first block of the next file.
-.TP 
+.TP
 .B bsf
 Backward space
 .I count
 files.
 The tape is positioned on the first block of the next file.
-.TP 
+.TP
 .B fsr
 Forward space
 .I count
 records.
-.TP 
+.TP
 .B bsr
 Backward space
 .I count
 records.
-.TP 
+.TP
 .B bsfm
 Backward space
 .I count
 file marks.
 The tape is positioned on the beginning-of-the-tape side of
 the file mark.
-.TP 
+.TP
 .B fsfm
 Forward space
 .I count
 file marks.
 The tape is positioned on the beginning-of-the-tape side of
 the file mark.
-.TP 
+.TP
 .B asf
 Absolute space to file number
 .IR count .
 Equivalent to rewind followed by fsf
 .IR count .
-.TP 
+.TP
 .B seek
 Seek to block number
 .IR count .
-.TP 
+.TP
 .B eom
 Space to the end of the recorded media on the tape
 (for appending files onto tapes).
-.TP 
+.TP
 .B rewind
 Rewind the tape.
-.TP 
+.TP
 .BR offline ", " rewoffl
-Rewind the tape and, if applicable, unload the tape.
-.TP 
+Rewind the tape and,
+if applicable,
+unload the tape.
+.TP
 .B status
 Print status information about the tape unit.
-.TP 
+.TP
 .B retension
-Rewind the tape, then wind it to the end of the reel,
+Rewind the tape,
+then wind it to the end of the reel,
 then rewind it again.
-.TP 
+.TP
 .B erase
-Perform long erase of tape. If
+Perform long erase of tape.
+If
 .I count
-is 0, perform short erase of tape (some devices do not support this).
+is 0,
+perform short erase of tape
+(some devices do not support this).
 .PP
 .B mt
-exits with a status of 0 if the operation succeeded, 1 if the
-operation or device name given was invalid, or 2 if the operation
-failed.
+exits with a status of 0
+if the operation succeeded,
+1 if the operation or device name given was invalid,
+or 2 if the operation failed.
 .SS OPTIONS
 .TP
 \fB\-f\fR, \fB\-\-file=\fIdevice\fR
@@ -137,11 +149,12 @@ Use
 .I device
 as the file name of the tape drive to operate on.
 To use a
-tape drive on another machine, use a filename that
-starts with `HOSTNAME:'.  The hostname can be preceded by a
-username and an `@' to access the remote tape drive as that user, if
-you have permission to do so (typically an entry in that user's
-`~/.rhosts' file).
+tape drive on another machine,
+use a filename that starts with `HOSTNAME:'.
+The hostname can be preceded by a username
+and an `@' to access the remote tape drive as that user,
+if you have permission to do so
+(typically an entry in that user's `~/.rhosts' file).
 .TP
 \fB\-\-rsh-command=\fIcommand\fR
 Notifies
@@ -156,7 +169,7 @@ or
 \fB\-V\fR, \fB\-\-version\fR
 Print the version number of
 .BR mt .
-.SH "BUG REPORTS"
+.SH BUG REPORTS
 Report bugs to <bug\[email protected]>.
 .SH COPYRIGHT
 Copyright \(co 2014 Free Software Foundation, Inc.
  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)

-.-

Reply via email to