diff mbox

[ovs-dev] dist-docs: Fix text and HTML versions of manpages with groff versions.

Message ID 1447261135-9741-1-git-send-email-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff Nov. 11, 2015, 4:58 p.m. UTC
Some versions of groff use termcap sequences for bold, italic, etc. by
default.  The dist-docs script doesn't cope with those; it expects
sequences based on backspacing and overprinting.  This commit fixes the
problem by setting an environment variable GROFF_NO_SGR that forces groff
to use backspacing.

Reported-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 build-aux/dist-docs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Russell Bryant Nov. 11, 2015, 5:15 p.m. UTC | #1
On 11/11/2015 11:58 AM, Ben Pfaff wrote:
> Some versions of groff use termcap sequences for bold, italic, etc. by
> default.  The dist-docs script doesn't cope with those; it expects
> sequences based on backspacing and overprinting.  This commit fixes the
> problem by setting an environment variable GROFF_NO_SGR that forces groff
> to use backspacing.
> 
> Reported-by: Russell Bryant <rbryant@redhat.com>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---
>  build-aux/dist-docs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/build-aux/dist-docs b/build-aux/dist-docs
> index 5857c1c..3792fa5 100755
> --- a/build-aux/dist-docs
> +++ b/build-aux/dist-docs
> @@ -103,9 +103,9 @@ EOF
>  (cd $distdir
>   for manpage in $manpages; do
>       man -l -Tps $manpage | ps2pdf - > $manpage.pdf
> -     man -l -Tutf8 $manpage | sed 's/.//g' > $manpage.txt
> +     GROFF_NO_SGR=1 man -l -Tutf8 $manpage | sed 's/.//g' > $manpage.txt
>       (echo '<html><head><meta charset="UTF-8"></head><body><pre>'
> -      man -l -Tutf8 $manpage | sed '
> +      GROFF_NO_SGR=1 man -l -Tutf8 $manpage | sed '
>  s/&/&amp;/g
>  s/</&lt;/g
>  s/>/&gt;/g
> 

This fixed the docs generation issue I had on my Fedora system.

Acked-by: Russell Bryant <rbryant@redhat.com>
Ben Pfaff Nov. 11, 2015, 5:20 p.m. UTC | #2
On Wed, Nov 11, 2015 at 12:15:47PM -0500, Russell Bryant wrote:
> On 11/11/2015 11:58 AM, Ben Pfaff wrote:
> > Some versions of groff use termcap sequences for bold, italic, etc. by
> > default.  The dist-docs script doesn't cope with those; it expects
> > sequences based on backspacing and overprinting.  This commit fixes the
> > problem by setting an environment variable GROFF_NO_SGR that forces groff
> > to use backspacing.
> > 
> > Reported-by: Russell Bryant <rbryant@redhat.com>
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> > ---
> >  build-aux/dist-docs | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/build-aux/dist-docs b/build-aux/dist-docs
> > index 5857c1c..3792fa5 100755
> > --- a/build-aux/dist-docs
> > +++ b/build-aux/dist-docs
> > @@ -103,9 +103,9 @@ EOF
> >  (cd $distdir
> >   for manpage in $manpages; do
> >       man -l -Tps $manpage | ps2pdf - > $manpage.pdf
> > -     man -l -Tutf8 $manpage | sed 's/.//g' > $manpage.txt
> > +     GROFF_NO_SGR=1 man -l -Tutf8 $manpage | sed 's/.//g' > $manpage.txt
> >       (echo '<html><head><meta charset="UTF-8"></head><body><pre>'
> > -      man -l -Tutf8 $manpage | sed '
> > +      GROFF_NO_SGR=1 man -l -Tutf8 $manpage | sed '
> >  s/&/&amp;/g
> >  s/</&lt;/g
> >  s/>/&gt;/g
> > 
> 
> This fixed the docs generation issue I had on my Fedora system.
> 
> Acked-by: Russell Bryant <rbryant@redhat.com>

Thanks, I applied this to master and branch-2.4.
diff mbox

Patch

diff --git a/build-aux/dist-docs b/build-aux/dist-docs
index 5857c1c..3792fa5 100755
--- a/build-aux/dist-docs
+++ b/build-aux/dist-docs
@@ -103,9 +103,9 @@  EOF
 (cd $distdir
  for manpage in $manpages; do
      man -l -Tps $manpage | ps2pdf - > $manpage.pdf
-     man -l -Tutf8 $manpage | sed 's/.//g' > $manpage.txt
+     GROFF_NO_SGR=1 man -l -Tutf8 $manpage | sed 's/.//g' > $manpage.txt
      (echo '<html><head><meta charset="UTF-8"></head><body><pre>'
-      man -l -Tutf8 $manpage | sed '
+      GROFF_NO_SGR=1 man -l -Tutf8 $manpage | sed '
 s/&/&amp;/g
 s/</&lt;/g
 s/>/&gt;/g