pkgsrc-Users archive

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

Re: print/a2ps from pkgsrc-2023Q1 broken.



On Fri, 7 Apr 2023, John D. Baker wrote:

> Looking at 'ktrace -i ...' of a typical call, it looks like NetBSD's
> 'getopt' is doing something wrong.  The script 'a2ps-lpr-wrapper'
> contains:
> 
> TEMP=$(getopt -o d: -n 'a2ps-lpr-wrapper' -- "$@")

The syntax above is wrong for NetBSD's 'getopt'.  The "-o" before the
first option specifier "d:" causes 'getopt' to immdiately signal the
end of option processing (outputs "--" at the beginning of the line).
The rest of the arguments to 'getopt' are copied verbatim and are
subsequently installed as the script's positional parameters by:

  set -- "$TEMP"

When 'a2ps-lpr-wrapper' parses its positional parameters, it
immediately sees the "--" option terminator and then assumes that
the rest of the line is a list of files to print.

In fact, the only valid option (w/argument) to 'a2ps-lpr-wrapper'
is "-d <printer>".  Anything other than that or the "--" option
terminator is supposed to cause the script to exit with an error.

So, I don't know what the above invocation of 'getopt' is supposed
to accomplish.  More likely it should be:

  TEMP=$(getopt d: -- "$@")

I just edited '/usr/pkg/bin/a2ps-lpr-wrapper' in this fashion and
it now works.

-- 
|/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
|\ / jdbaker[snail]consolidated[flyspeck]net  OpenBSD            FreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645


Home | Main Index | Thread Index | Old Index