bugGNU troff - Bugs: bug #61454, [PATCH] nroff -V ...: show the...


bug #61454: [PATCH] nroff -V ...: show the (final, real) pipe line

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Wed 10 Nov 2021 12:55:54 AM UTC
Category:  Core Severity:  1 - Wish
Item Group:  Feature change Status:  Wont Fix
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:
       No canned response available


Wed 10 Nov 2021 11:08:39 PM UTC, comment #3: 

You original message was not clear.

It appears that what you're asking for is for `nroff -V` to work as groff `-V` does.

I don't think that's a good idea.

If you're troubleshooting a pipeline, it's wise to start discarding wrappers like `nroff`.

G. Branden Robinson <gbranden>
Project Administrator
Wed 10 Nov 2021 08:20:38 PM UTC, comment #2: 

  You have forgotten to have the option '-V' in the substituted line.

  To see the difference it is better to add

echo ----
<new command line with -V >

than to substitute.

Bjarni Ingi Gislason <bjarniig>
Wed 10 Nov 2021 01:45:23 AM UTC, comment #1: 

Please read the comment immediately above the material you're patching.

# Unfortunately, the shell is a nightmarish hellscape of quoting issues.
# Naïve attempts to solve the problem fail when arguments to nroff
# contain embedded whitespace or shell metacharacters.  The solution
# below works with those, but there is insufficient quoting in -V (dry
# run) mode, such that you can't copy-and-paste the output of 'nroff -V'
# if you pass it a filename like foo"bar (with the embedded quotation
# mark) and expect it to run without further quoting.

There are at least 2 problems with your patch.

1. It ignores the meaning of the -V option and executes the command instead of writing it to the standard output stream.

$ echo "foobar" | GROFF_TEST_GROFF=./test-groff ./nroff -V -t -ms | cat -s


2. It exhibits the very problem warned about in the comment.

$ GROFF_TEST_GROFF=./test-groff ./nroff -V -t -ms foo\"bar.man
./nroff: 1: eval: Syntax error: Unterminated quoted string

I do not see how this patch constitutes an improvement on the existing code in any way, and the attached description does not help me to understand how the existing code is inadequate, if at all.

Please take the time to clearly describe a defect along with, prior to, or instead of providing a patch.

G. Branden Robinson <gbranden>
Project Administrator
Wed 10 Nov 2021 12:55:54 AM UTC, original submission:  

Subject: [PATCH]?: nroff -V ...: show the (final, real) pipe line

  Test with "nroff -ms -e -t -p -V"


  "test-nroff -ms -e -t -p -V" (or GROFF_TEST_GROFF=... nroff ...)

  I can't compile "master branch" as it has old "gnulib" version (?)
(and possibly old "automake" and "autoconf" files).


diff -dpru --unidirectional-new-file groff/src/roff/nroff/nroff.sh new-groff/src/roff/nroff/nroff.sh
--- groff/src/roff/nroff/nroff.sh 2021-11-10 00:24:39.000000000 +0000
+++ new-groff/src/roff/nroff/nroff.sh 2021-11-10 00:28:48.000000000 +0000
@@ -189,7 +189,7 @@ groff=${GROFF_TEST_GROFF-groff}
 # zero.
 if [ -n "$dry_run" ]
-  echo PATH="$GROFF_RUNTIME$PATH" $groff $T $opts ${1+"$@"}
+  eval $(echo PATH="$GROFF_RUNTIME$PATH" $groff $T -V $opts ${1+"$@"}; )
   PATH="$GROFF_RUNTIME$PATH" $groff $T $opts ${1+"$@"}

Bjarni Ingi Gislason <bjarniig>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-05 gbranden CategoryNone Core
        Summary[PATCH]?: nroff -V ...: show the (final, real) pipe line [PATCH] nroff -V ...: show the (final, real) pipe line
    2021-11-10 gbranden Severity3 - Normal 1 - Wish
        StatusInvalid Wont Fix
    2021-11-10 gbranden StatusNone Invalid
        Assigned toNone gbranden
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.9