dist-docs: Fix text and HTML manpage generation with some groff versions.
authorBen Pfaff <blp@ovn.org>
Wed, 11 Nov 2015 16:58:51 +0000 (08:58 -0800)
committerBen Pfaff <blp@ovn.org>
Wed, 11 Nov 2015 17:20:07 +0000 (09:20 -0800)
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.

Found on Fedora.

Reported-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <rbryant@redhat.com>
build-aux/dist-docs

index 5857c1c..3792fa5 100755 (executable)
@@ -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/.\b//g' > $manpage.txt
+     GROFF_NO_SGR=1 man -l -Tutf8 $manpage | sed 's/.\b//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