Package: gawk
Version: 1:5.2.1-2+b1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with

[test-]groff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z < "man page"

  [test-groff is a script in the repository for "groff"] (local copy and
"troff" slightly changed by me).

   * What was the outcome of this action?


troff: backtrace: file '<stdin>':149
troff:<stdin>:149: warning: trailing space in the line

lexgrog: pm-gawk.1: parse failed

   * 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.10.9-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 gawk depends on:
ii  libc6            2.40-2
ii  libgmp10         2:6.3.0+dfsg-2+b1
ii  libmpfr6         4.2.1-1+b1
ii  libreadline8t64  8.2-5
ii  libsigsegv2      2.14-1+b1

gawk recommends no packages.

Versions of packages gawk suggests:
pn  gawk-doc  <none>

-- no debconf information
  Any program (person), that produces man pages, should check its content for
defects by using

groff -mandoc -t -ww -b -z [ -K utf8 | k ] <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 outputs 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)

-.-.

Output from "mandoc -T lint pm-gawk.1": (possibly shortened list)

mandoc: pm-gawk.1:28:2: WARNING: skipping paragraph macro: PP after SH
mandoc: pm-gawk.1:56:2: WARNING: skipping paragraph macro: PP after SH
mandoc: pm-gawk.1:129:2: WARNING: skipping paragraph macro: PP after SH
mandoc: pm-gawk.1:140:2: WARNING: skipping paragraph macro: PP after SH
mandoc: pm-gawk.1:149:12: STYLE: whitespace at end of input line

-.-.

Remove space characters at the end of lines.

Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

149:implemented 

-.-.

Change (or include a "FIXME" paragraph about) misused SI (metric)
numeric prefixes (or names) to the binary ones, like Ki (kibi), Mi
(mebi), Gi (gibi), or Ti (tebi), if indicated.
If the metric prefixes are correct, add the definitions or an
explanation to avoid misunderstanding.

62:$ \f(CBtruncate -s 1G heap.pma\fP            # create heap file

-.-.

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.

9:truncate -s \f(CIsize\fP heap.pma
13:truncate -s \f(CIsize\fP heap.pma
16:truncate -s \f(CIsize\fP heap.pma
62:$ \f(CBtruncate -s 1G heap.pma\fP            # create heap file

-.-.

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.

N.B.

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

161:for the persistent memory allocator. Do not use a backing file

-.-.

Add a zero (0) in front of a decimal fraction that begins with a period
(.)

58:.sp .5
75:.sp .5
91:.sp .5
105:.sp .5
119:.sp .5

-.-.

Do not begin a decimal fraction with a period (.), but with a zero (0).

58:.sp .5
75:.sp .5
91:.sp .5
105:.sp .5
119:.sp .5

-.-.

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

troff: backtrace: file '<stdin>':149
troff:<stdin>:149: warning: trailing space in the line

lexgrog: pm-gawk.1: parse failed

man -k pm-gawk:

pm-gawk (1)          - (unknown subject)
--- pm-gawk.1   2024-09-20 21:36:37.369046974 +0000
+++ pm-gawk.1.new       2024-09-20 21:26:54.103061878 +0000
@@ -2,18 +2,18 @@
 .ds PM \fIPersistent Memory gawk User Manual\fP
 .TH PM-GAWK 1 "Nov 17 2022" "Free Software Foundation" "Utility Commands"
 .SH NAME
-persistent memory gawk \- persistent data and functions
+pm-gawk \- persistent memory gawk, persistent data and functions
 .SH SYNOPSIS
 .ft CW
 .nf
-truncate -s \f(CIsize\fP heap.pma
+truncate \-s \f(CIsize\fP heap.pma
 export GAWK_PERSIST_FILE=heap.pma
 gawk .\^.\^.
 .sp
-truncate -s \f(CIsize\fP heap.pma
+truncate \-s \f(CIsize\fP heap.pma
 GAWK_PERSIST_FILE=heap.pma gawk .\^.\^.
 .sp
-truncate -s \f(CIsize\fP heap.pma
+truncate \-s \f(CIsize\fP heap.pma
 alias pm='GAWK_PERSIST_FILE=heap.pma'
 pm gawk .\^.\^.                       # succinct
 .sp
@@ -25,7 +25,6 @@ rm heap.pma               # delete heap
 .fi
 .ft R
 .SH DESCRIPTION
-.PP
 .I Gawk
 5.2 and later supports a persistent memory feature that
 can store script-defined variables and functions in a
@@ -53,13 +52,12 @@ extension: it offers constant-time (``O(
 elements of persistent associative arrays, and it can store script-defined
 functions in addition to variables.
 .SH EXAMPLES
-.PP
 Demonstrate persistent variables:
-.sp .5
+.sp 0.5
 .RS
 .nf
 .ft CW
-$ \f(CBtruncate -s 1G heap.pma\fP            # create heap file
+$ \f(CBtruncate \-s 1G heap.pma\fP            # create heap file
 $ \f(CBexport GAWK_PERSIST_FILE=heap.pma\fP  # "ambient" env var
 $ \f(CBgawk 'BEGIN { print ++i }'\fP
 1
@@ -72,7 +70,7 @@ $ \f(CBgawk 'BEGIN { print ++i }'\fP
 .RE
 .PP
 To pass the environment variable on per-command basis:
-.sp .5
+.sp 0.5
 .RS
 .nf
 .ft CW
@@ -88,7 +86,7 @@ $ \f(CBGAWK_PERSIST_FILE=heap.pma gawk '
 .RE
 .PP
 To reduce visual clutter of per-command environment variable passing:
-.sp .5
+.sp 0.5
 .RS
 .nf
 .ft CW
@@ -102,7 +100,7 @@ $ \f(CBpm gawk 'BEGIN { print ++i }'\fP
 .RE
 .PP
 To refrain from activating persistence:
-.sp .5
+.sp 0.5
 .RS
 .nf
 .ft CW
@@ -116,7 +114,7 @@ $ \f(CBgawk 'BEGIN { print ++i }'\fP
 .RE
 .PP
 To permanently ``forget'' the contents of the heap file:
-.sp .5
+.sp 0.5
 .RS
 .nf
 .ft CW
@@ -124,9 +122,7 @@ $ \f(CBrm heap.pma\fP
 .ft R
 .fi
 .RE
-.PP
 .SH ENVIRONMENT VARIABLES
-.PP
 \f(CWGAWK_PERSIST_FILE\fP contains the name of a heap file where
 script-defined variables and functions are stored.  If this environment
 variable is not visible to
@@ -137,7 +133,6 @@ persistence feature is not activated and
 behaves in
 its traditional manner.
 .SH VERSION INFORMATION
-.PP
 Persistent memory
 .I gawk
 was first released in
@@ -146,7 +141,7 @@ was first released in
 .SH AUTHORS
 Arnold Robbins, the maintainer of
 .IR gawk ,
-implemented 
+implemented
 .I pm-gawk
 using a persistent memory allocator (pma) provided by
 Terence Kelly.  An earlier proof-of-concept prototype
@@ -158,8 +153,8 @@ Tan, and Jianan Li using a fork of the o
 sources.
 .SH CAVEATS
 The GNU/Linux CIFS filesystem is known to cause problems
-for the persistent memory allocator. Do not use a backing file
-on such a filesystem with
+for the persistent memory allocator.
+Do not use a backing file on such a filesystem with
 .IR pm-gawk .
 .SH BUG REPORTS
 Follow the procedures in \*(EP and in \*(PM.

Reply via email to