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:

> Attempting to print even a simple text file fails with:
> 
> $ a2ps -1 -s2 /etc/printcap
> [/etc/printcap (plain): 2 pages on 1 sheet]
> lpr: cannot access d:: No such file or directory
> lpr: cannot access -n: No such file or directory
> lpr: cannot access a2ps-lpr-wrapper: No such file or directory
> lpr: cannot access --: No such file or directory
> a2ps: received SIGPIPE
> 
> It appears a2ps is calling 'lpr' but passing bogus options/arguments?
> 
> This is 10.0_BETA/amd64.

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' -- "$@")

and the ktruss output shows:

[...]
 9654   9654 getopt   CALL  write(1,0x73f4fc19ae00,0x1e)
  9654   9654 getopt   GIO   fd 1 wrote 30 bytes
       " -- d: -n a2ps-lpr-wrapper --\n"
  9654   9654 getopt   RET   write 30/0x1e
  9654   9654 getopt   CALL  exit(0)
  2529   2529 sh       GIO   fd 3 read 30 bytes
       " -- d: -n a2ps-lpr-wrapper --\n"
  2529   2529 sh       RET   read 30/0x1e
[...]

which causes 'a2ps-lpr-wrapper' to terminate option processing
(the first "--"), and take the rest of the list as files to print.

This command line is then passed to 'lp', which passes it to 'lpr',
which then attempts to open these supposed files, producing the
error message above.

-- 
|/"\ 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