bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61040] [nroff]: verbose_option_works.sh: confounded by GROFF_TYPES


From: G. Branden Robinson
Subject: [bug #61040] [nroff]: verbose_option_works.sh: confounded by GROFF_TYPESETTER in environment
Date: Fri, 20 Aug 2021 22:19:32 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Update of bug #61040 (project groff):

                Severity:                1 - Wish => 3 - Normal             
                  Status:                Wont Fix => In Progress            
             Open/Closed:                  Closed => Open                   
                 Summary: verbose_option_works.sh: option "-T..." for "nroff"
is a variable, but a constant in the test string => [nroff]:
verbose_option_works.sh: confounded by GROFF_TYPESETTER in environment

    _______________________________________________________

Follow-up Comment #3:

[comment #2 comment #2:]
>   The test failed with "-Tlatin1" being different from "-Tascii".

How did you manage to cause this to happen?  I would have thought the LC_ALL=C
on line 22 would have prevented this...Ah, I see, you probably have
GROFF_TYPESETTER=latin1 in your environment.  I'll close that avenue for
confoundation of the test.

>   So I thought the "-T" option was the test.

The name of the file says that it is a test of the verbose option (-V); it is
not a test of the operation of the -T option.

>   Now looking at the content of the test,
> it is now evident to me,
> that the real test is to find out
> if the used shell resolves correctly the parameter expansion
> '${1+"$@"}'

The name of the file says that it is a test of the verbose option (-V); it is
not a test of the underlying shell.  The test is there to make sure that we
construct the groff command line as we expect to even if the command operands
are unusual.  If the shell fails to expand parameters as we expect, then we
either have to alter nroff.sh to accommodate its behavior, or disclaim support
for that shell.

>   I see two solutions
> 
> 1) add "-Tascii" to the nroff command
> 
> 2) add " -- " after the options to "nroff"
>    change the "sedexpr" to '^.* -- ' and the testing string for "groff"
> accordingly.

I don't understand what problem you are trying to solve here.  I assume one of
the ones above which are expressly outside the mission of the test script.

>   A test for invalid arguments to the "-T" option is missing,
> otherwise a value from the environment is supplied without telling the
> user.

The test script (for the verbose option working) doesn't do this, but nroff
itself has clearly documented semantics.

>From the nroff(1) man page:

       Consequently, acceptable arguments to the -T option are ascii,
       latin1, utf8, and cp1047; any others are ignored.  If neither the
       GROFF_TYPESETTER environment variable nor the -T command-line
       option (which overrides the environment variable) specifies a
       (valid) device, nroff consults the locale to select an
       appropriate output device.  It first tries the locale(1) program,
       then checks several locale-related environment variables; see
       section “Environment”, below.  If all of the foregoing fail,
       -Tascii is implied.


Your troubles with this script have arisen from (1) your commitment to a
legacy ISO 8859 character encoding in your terminal environment (that's fine,
if a bit hidebound, and a configuration we should support) and (2) my failure
to anticipate the test being run in an environment where GROFF_TYPESETTER was
set.  As noted above, I'll fix that.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61040>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]