]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make it possible to copy&paste strings from the HTML-formatted man pages.
authorBruno Haible <bruno@clisp.org>
Tue, 24 Jul 2018 22:25:09 +0000 (00:25 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 24 Jul 2018 22:25:09 +0000 (00:25 +0200)
* gettext-runtime/man/Makefile.am (MAN2HTML_POSTPROCESS): New variable.
(gt_man2html): Use it.
* gettext-tools/man/Makefile.am (MAN2HTML_POSTPROCESS): New variable.
(gt_man2html): Use it.

gettext-runtime/man/Makefile.am
gettext-tools/man/Makefile.am

index a759c2e58f669ab3dbb3ba03846c07620f56a0ce..68691c1b8f06fba14612389211d0a5db6569c661 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the gettext-runtime/man subdirectory of GNU gettext
-## Copyright (C) 2001-2003, 2006, 2009, 2015-2016 Free Software Foundation,
+## Copyright (C) 2001-2003, 2006, 2009, 2015-2018 Free Software Foundation,
 ## Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
@@ -63,6 +63,10 @@ HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
 
 # groff 1.17 or newer.
 MAN2HTML = groff -mandoc -Thtml
+# Some versions of groff -Thtml map '\-' to '&minus;' = U+2212, which yields
+# the wrong result when copy&pasting command-line options and such.
+# Also remove 'CreationDate:' lines, for reproducible builds.
+MAN2HTML_POSTPROCESS = sed -e 's/\&minus;/-/g' -e '/CreationDate:/d'
 
 UPDATEMODE =
 
@@ -70,7 +74,7 @@ UPDATEMODE =
 gt_man2html = \
        if test -f $${srcdir}$$m; then \
          $(MAN2HTML) $${srcdir}$$m > t-$@ && \
-         sed -e '/CreationDate:/d' < t-$@ > t2-$@ && \
+         $(MAN2HTML_POSTPROCESS) < t-$@ > t2-$@ && \
          mv t2-$@ $@; \
          rm -f t-$@ t2-$@; \
        fi
index 4b0a0ec747eaec8514312ebdf37496e9850b1666..0c514304a25c88c1eed881799959e1890c0ccad2 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the gettext-tools/man subdirectory of GNU gettext
-## Copyright (C) 2001-2003, 2006-2007, 2015-2016 Free Software Foundation, Inc.
+## Copyright (C) 2001-2003, 2006-2007, 2015-2018 Free Software Foundation, Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -61,6 +61,10 @@ HELP2MAN = $(PERL) -w -- $(srcdir)/help2man
 
 # groff 1.17 or newer.
 MAN2HTML = groff -mandoc -Thtml
+# Some versions of groff -Thtml map '\-' to '&minus;' = U+2212, which yields
+# the wrong result when copy&pasting command-line options and such.
+# Also remove 'CreationDate:' lines, for reproducible builds.
+MAN2HTML_POSTPROCESS = sed -e 's/\&minus;/-/g' -e '/CreationDate:/d'
 
 UPDATEMODE =
 
@@ -68,7 +72,7 @@ UPDATEMODE =
 gt_man2html = \
        if test -f $${srcdir}$$m; then \
          $(MAN2HTML) $${srcdir}$$m > t-$@ && \
-         sed -e '/CreationDate:/d' < t-$@ > t2-$@ && \
+         $(MAN2HTML_POSTPROCESS) < t-$@ > t2-$@ && \
          mv t2-$@ $@; \
          rm -f t-$@ t2-$@; \
        fi