[PATCH] docs: gnuconfig manual page generating

Pavel Raiskup <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <[email protected]>
Don't generate empty manual pages when config.sub/config.guess
files are updated in distribution tarball and help2man is not
installed; don't fail either.

Resist on not 'touch'ing the old pre-generated manual page to not
hide the problem, however.  Also for git builds stay fatal and
enforce help2man installation; just to avoid generating broken
distribution tarballs.

References:
https://bugzilla.redhat.com/1162227

* man/local.mk (.x.1): Detect missing 'help2man', don't reubild
the manpage then, be fatal if building against git.
---
 man/local.mk | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/man/local.mk b/man/local.mk
index 7514ec4..3f3cffc 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -60,11 +60,18 @@ SUFFIXES += .x .1
 	    --include=$*.x \
 	    --include=$(srcdir)/man/common.x \
 	    --source='$(PACKAGE_STRING)' \
-	    [email protected] `echo '$*' | sed 's,.*/,,'`
-	if sed $(remove_time_stamp) $@ >[email protected] 2>/dev/null && \
-	   sed $(remove_time_stamp) [email protected] | cmp [email protected] - >/dev/null 2>&1; then \
-		touch $@; \
-	else \
-		mv [email protected] $@; \
-	fi
-	rm -f $@*.t
+	    [email protected] `echo '$*' | sed 's,.*/,,'` ; \
+	rc=$$? ; \
+	if test $$rc -eq 127; then \
+	  test ! -e "$(top_srcdir)/.git" && rc=0 ; \
+	elif test $$rc -eq 0; then \
+	  if sed $(remove_time_stamp) $@ >[email protected] 2>/dev/null && \
+	     sed $(remove_time_stamp) [email protected] | cmp [email protected] - >/dev/null 2>&1; then \
+	    touch $@; \
+	  else \
+	    mv [email protected] $@; \
+	  fi ; \
+	  rc=$$? ; \
+	fi ; \
+	rm -f $@*.t ; \
+	exit $$rc
-- 
1.9.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.