From: Bruno Haible Date: Tue, 24 Jul 2018 22:25:09 +0000 (+0200) Subject: Make it possible to copy&paste strings from the HTML-formatted man pages. X-Git-Tag: v0.20~402 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d03803f8a71a6a36e3ca0c53880beff22c488b0e;p=thirdparty%2Fgettext.git Make it possible to copy&paste strings from the HTML-formatted man pages. * 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. --- diff --git a/gettext-runtime/man/Makefile.am b/gettext-runtime/man/Makefile.am index a759c2e58..68691c1b8 100644 --- a/gettext-runtime/man/Makefile.am +++ b/gettext-runtime/man/Makefile.am @@ -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 '−' = 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/\−/-/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 diff --git a/gettext-tools/man/Makefile.am b/gettext-tools/man/Makefile.am index 4b0a0ec74..0c514304a 100644 --- a/gettext-tools/man/Makefile.am +++ b/gettext-tools/man/Makefile.am @@ -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 '−' = 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/\−/-/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