OpenCSW Bug Tracker


Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004280 [groff] regular use minor always 2010-02-16 19:22 2011-01-29 12:58
Reporter skayser View Status public  
Assigned To james
Priority normal Resolution fixed  
Status closed  
Summary 0004280: /opt/csw/share/groff/1.20.1/tmac/doc.tmac:3375: bad character definition
Description Tested on build10x. When trying to format the autossh man page with gnroff, gnroff throws a warning:

$ gnroff -man autossh.1 > /dev/null
/opt/csw/share/groff/1.20.1/tmac/doc.tmac:3375: bad character definition

The first part of the formatted man page (everything before the first .Sh) looks a bit garbled, although I don't know whether that's because of the above warning.

R] .if 0nl] . setup-header
...
UNTITLED LOCAL UNTITLED
...
$] .tm Usage: .Sh section_name ... (#0.c])

I have attached the man page so that you can reproduce the warning message if necessary (and maybe shed some light on the garbled output). WRT to the warning message there is also a related bug report over at Gentoo: http://bugs.gentoo.org/263524. [^]
Additional Information $ pkgparam CSWgroff VERSION
1.20.1,REV=2009.07.16
Tags No tags attached.
Attached Files ? file icon autossh.1 [^] (9,525 bytes) 2010-02-16 19:22

- Relationships

-  Notes
(0007453)
james (reporter)
2010-02-16 21:05

The offending command is .Dd. It's not a standard man page, "man -s 5 man", should start .TH not .Dd. As it's short it would be easier to rewrite than debug why .Dd is failing. Even with the error it does format but you might try the following:

sed -e '/.TH/a\
.ll 65n' autossh.1 | groff -te -T ascii -m man | sed -e 's/[^m]*m//g' -e 's/~/ /g' > catman

There are bare escapees in the line which you won't see in this report. If you look at the out put you'll see the chars than need to convert the terminal
control to text - I expect that is a groff flag for this if I looked carefully!
(0007479)
james (reporter)
2010-02-19 11:06

I played with this some more last night but still can't find why it reports the bad char but even with message it produced output. Reading "man groff_man" the page isn't even a groff standard man page so rewrite it first and then re-ask the question on groff. It will need rewriting as a standard man page suitable for /usr/bin/man (unless pre-formatted for cat) so rewrite it properly in the first place and forget groff. Ask if you need help with this.
(0007484)
james (reporter)
2010-02-20 12:46

The autossh.1 man source file fits the groff mdoc format. Should be available with "man groff_mdoc" except the man page is, hurrah, mdoc format and therefore broken. View with:

$ gnroff -mdoc /opt/csw/share/man/man7/groff_mdoc.7 | more

use the same flag with autossh.1 to get formatted text. The same "bad character definition" message is thrown up but it does work. I'll investigate this warning in the general case but the autossh man page still needs writing if it's to work with /usr/bin/man (or provide cat man pre-formatted).

A way round this generally would be to add an alternative man system that used groff. Seems like utter stupidity to me just to compensate for people that can't (be bothered to) write a correct man page.
(0007485)
james (reporter)
2010-02-20 15:34

This is a bug in groff and not the packaging nor autossh.1.

Workaround is:

--- doc.tmac.orig 2009-07-16 12:01:35.000000000 +0100
+++ doc.tmac 2010-02-20 14:32:24.489689000 +0000
@@ -3372,7 +3372,7 @@
 .blm empty-line
 .if '\*[.T]'utf8' \{\
 .rchar \- - ' `
-.char \- \N'45'
+.rchar \- \N'45'
 .char - \N'45'
 .char ' \N'39'
 .char ` \N'96'
(0007514)
skayser (administrator)
2010-02-24 00:21

Thanks very much for all the explanation James! Further to this I found the roff(7) man page a very enlightening read, in particular on how the differents sub parts fit together (groff, gtroff/gnroff, grotty and such). WRT to the autossh package, it now ships with a pre-formatted catman man page which is produced via

  groff -m doc -Tascii -P-cuob $(WORKSRC)/autossh.1

For future reference, if anyone stumbles upon a man page which won't properly format with the man macro package, the grog(1) utility tries to heuristicly determine the macro package that is used by a particular man page (and by this the groff invocation line which is suitable to produce intermediary roff output).

Example:

$ grog ./work/build-isa-sparcv8/autossh-1.4b/autossh.1
groff -mdoc ./work/build-isa-sparcv8/autossh-1.4b/autossh.1

Then either of:
$ groff -Tascii -mdoc ./work/build-isa-sparcv8/autossh-1.4b/autossh.1
$ gnroff -mdoc ./work/build-isa-sparcv8/autossh-1.4b/autossh.1
... (nicely formatted man page) ...
(0008731)
james (reporter)
2011-01-22 18:55

1.21,REV=2011.01.20 has this rchar patch so should resolve this issue.


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker