From d05e91c7b6c84b22cab3f30abdf3490b7c83910b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 30 Sep 2017 17:08:02 -0700 Subject: [PATCH] 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. * NEWS: Mention the build-related change. --- NEWS | 5 +++++ man/dummy-man | 23 ++++++++++++----------- man/local.mk | 16 +++++++++++----- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index 5d57c72..2878b70 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 f05ce2a..e298295 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 <"$output" </dev/null || :`} \ + && : $${TZ=UTC} && export TZ \ && export SOURCE_DATE_EPOCH && $(run_help2man) \ --source='$(PACKAGE_STRING)' \ --include=$(srcdir)/man/$$name.x \ @@ -198,4 +204,4 @@ endif $$t/$$name.1 > address@hidden \ && rm -rf $$t \ && chmod a-w address@hidden \ - && mv address@hidden $@ + && rm -f $@ && mv address@hidden $@ -- 2.9.3