FS#15479 - [groff] Converting man pages to postscript broken due to site.tmac bugs

Attached to Project: Arch Linux
Opened by Lasse Collin (Larhzu) - Saturday, 11 July 2009, 09:10 GMT
Last edited by Paul Mattal (paul) - Sunday, 07 March 2010, 22:17 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Paul Mattal (paul)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Package version: groff-1.20.1-2-x86_64

Steps to reproduce:

zcat /usr/share/man/man1/groff.1.gz | groff -man -Tps > foo.ps
your_preferred_ps_viewer foo.ps

foo.ps starts with an extra empty page, which shouldn't be there. Note also the warning printed on standard error:

grops:<standard input>:6: X command without `ps:' tag ignored

How to fix:

site.tmac should have no empty lines, because even one empty line adds an extra empty page. The command to disable SGR is not recognized by grops (it's a command specific to grotty), and messes up the first page. site.tmac also lacks braces from the first .if request, so only the first .char request is used conditionally.

I suggest enclosing the contents of site.tmac inside ".if n \{\ ... .\}", which executes the contents only when producing text output (this is how at least Slackware does it). A fixed site.tmac is attached.
This task depends upon

Closed by  Paul Mattal (paul)
Sunday, 07 March 2010, 22:17 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed per the suggestions here in groff 1.20.1-4.
Comment by Paul Mattal (paul) - Saturday, 06 March 2010, 20:59 GMT
I don't know much about groff, but will try to wade in.

I don't see a site.tmac file in groff (1.20.1-3-i686); are you recommending we add one with the contents above?
Comment by Lasse Collin (Larhzu) - Sunday, 07 March 2010, 16:56 GMT
I recommend that you replace your current Arch Linux specific site.tmac in the SVN repo with my fixed one. site.tmac is used to create man.local and mdoc.local. See the PKGBUILD for details. I have used man.local and mdoc.local files based on my site.tmac since I reported this bug and it has worked fine.
Comment by Paul Mattal (paul) - Sunday, 07 March 2010, 18:11 GMT
Ah, right. My confusion; I see now.

I'll do this, unless someone objects before I get to it.

Loading...