Bug 217649

Summary: Incorrect processing of <funcsynopsisinfo> by docbook2man
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: docbook-utilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-21 08:13:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Sample Docbook soruce none

Description Sam Varshavchik 2006-11-29 04:48:19 UTC
Description of problem:

docbook2man does not correctly convert <funcsynopsisinfo>.

Version-Release number of selected component (if applicable):

0.6.14

How reproducible:

Always

Steps to Reproduce:

1. Run docbook2man on test.sgml, attached to this bug
  
Actual results:

The contents of the output file, example.2, are:

.SH SYNOPSIS
.sp
\fB#include <unistd.h>
#include <sys/types.h>
#include <linux/unistd.h>
#include <errno.h>
_syscall5(int, _llseek, unsigned int, fd, unsigned long, hi,
unsigned long, lo, loff_t *, res, unsigned int, wh)
.sp
int foobar(void);
\fR

Expected results:

.SH SYNOPSIS
.sp
.nf
\fB#include <unistd.h>

#include <sys/types.h>

#include <linux/unistd.h>

#include <errno.h>

_syscall5(int, _llseek, unsigned int, fd, unsigned long, hi,
unsigned long, lo, loff_t *, res, unsigned int, wh)
\fR
.fi
.sp
\fB
int foobar(void);
\fR

Additional info:

"Docbook, The Definitive Guide", says this about the <funcsynopsisinfo> tag:

<<snip>>
Processing expectations
=======================

This element is displayed "verbatim"; whitespace and linebreaks within this
element are significant.
<<snip>>

Whitespace and linebreaks in <funcsynopsisinfo> ARE SIGNIFICANT, therefore it
should be copied verbatim, and no-filled.  The .sp before the .nf, or after the
.fi, may or may not be needed, not sure which way it will looks pretty.

Indeeed, if docbook2man's current output is run through nroff/man, the result is
a predictable mishmash:

SYNOPSIS
       #include  <unistd.h>  #include  <sys/types.h> #include <linux/unistd.h>
       #include <errno.h> _syscall5(int, _llseek, unsigned int,  fd,  unsigned
       long,  hi, unsigned long, lo, loff_t *, res, unsigned int, wh)

Yuck.  The E-mail address listed in the nroff header, Steve Cheng
<steve>, appears to be dead, ggi-project.org has no DNS MX or A
records.

Comment 1 Sam Varshavchik 2006-11-29 04:48:19 UTC
Created attachment 142363 [details]
Sample Docbook soruce

Comment 2 Petr Mejzlik 2007-04-24 15:03:33 UTC
Committed a fix (in  docbook2man-spec.pl).