From: Pádraig Brady
Date: Sun, 1 Oct 2017 00:08:02 +0000 (-0700)
Subject: build: reinstate distribution of man pages
X-Git-Tag: v8.29~51
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=856b828320649d941097a89dbb8c5343760ddad0;p=thirdparty%2Fcoreutils.git
build: reinstate distribution of man pages
man pages change little between systems,
so falling back to distributed pages make sense
when cross compiling or lacking perl.
* man/local.mk: Add all man pages to EXTRA_DIST
so that they're distributed in the generated tarball.
Use the dummy-man page generator if cross compiling.
Set TZ to avoid a distcheck failure where man pages
used a diffent month than those rebuilt (with a .timestamp).
* man/dummy-man: Only fall back to generating a stub
if copying an existing man page fails.
* man/help2man: Sync portable TZ=UTC0 specification
from upstream help2man.
* NEWS: Mention the build-related change.
Fixes https://bugs.gnu.org/28574
---
diff --git a/NEWS b/NEWS
index 5d57c727a3..2878b702d3 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,11 @@ GNU coreutils NEWS -*- outline -*-
to attempt to hide the original length of the file name.
[bug introduced in coreutils-8.28]
+** Build-related
+
+ Default man pages are now distributed which are used if perl is
+ not available on the build system, or when cross compiling.
+
* Noteworthy changes in release 8.28 (2017-09-01) [stable]
diff --git a/man/dummy-man b/man/dummy-man
index f05ce2ab4f..e298295d02 100755
--- a/man/dummy-man
+++ b/man/dummy-man
@@ -1,8 +1,7 @@
#!/bin/sh
-# Poor man's placeholder for help2man invocation on systems lacking perl;
-# it generates a dummy man page stating that a proper one could not be
-# generated, and redirecting the user back to either the info
-# documentation or the '--help' output.
+# Poor man's placeholder for help2man invocation on systems lacking perl,
+# or when cross compiling.
+# It just copies the distributed man pages.
set -e; set -u
@@ -24,12 +23,12 @@ while test $# -gt 0; do
# Help2man options we recognize and handle.
--output=*) output=`expr x"$1" : x'--output=\(.*\)'`;;
--output) shift; output=$1;;
+ --include=*) include=`expr x"$1" : x'--include=\(.*\)'`;;
+ --include) shift; include=$1;;
--source=*) source=`expr x"$1" : x'--source=\(.*\)'`;;
--source) shift; source=$1;;
# Recognize (as no-op) other help2man options that might be used
# in the makefile.
- --include=*);;
- --include) shift;;
--info-page=*);;
-*) fatal_ "invalid or unrecognized help2man option '$1'";;
--) shift; break;;
@@ -41,10 +40,13 @@ done
test $# -gt 0 || fatal_ "missing argument"
test $# -le 1 || fatal_ "too many non-option arguments"
+dist_man=$(printf '%s\n' "$include" | sed 's/\.x$/.1/')
+test -f "$dist_man" && cp "$dist_man" "$output" && exit || :
+
baseout=`basename_ "$output"`
sed 's/^/WARNING: /' >&2 <