From 206f9fdf8691616666801b432857df3da391870d Mon Sep 17 00:00:00 2001 From: "Robert C. Sheets" Date: Thu, 27 Aug 2015 03:18:51 -0700 Subject: [PATCH 1/3] Bail out with a useful message if a required command isn't available --- autogen.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/autogen.sh b/autogen.sh index 4b2af12..e2ece19 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,22 @@ #!/bin/sh +set -e + +needed='rm mkdir autoreconf echo' +if ! type $needed >/dev/null +then + for cmd in $needed + do + if ! type $cmd >/dev/null + then + # Have type print an error message for each missing command + type $cmd || true + fi + done + echo A required command is missing. Unable to continue. + exit 1 +fi + rm -rf autom4te.cache rm -f depcomp aclocal.m4 missing config.guess config.sub install-sh rm -f configure config.h.in config.h.in~ m4/libtool.m4 m4/lt*.m4 Makefile.in From a62db28570e14168fe033c7de1ab70f28d56a9fe Mon Sep 17 00:00:00 2001 From: "Robert C. Sheets" Date: Thu, 27 Aug 2015 03:21:44 -0700 Subject: [PATCH 2/3] One more comment --- autogen.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/autogen.sh b/autogen.sh index e2ece19..847cfc8 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,6 +2,7 @@ set -e +# Commands this script needs needed='rm mkdir autoreconf echo' if ! type $needed >/dev/null then From b3b2964752836beac198026b62c90c18245e118f Mon Sep 17 00:00:00 2001 From: "Robert C. Sheets" Date: Thu, 27 Aug 2015 10:47:48 -0700 Subject: [PATCH 3/3] When type output is not wanted, redirect all output instead of just stdout --- autogen.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 847cfc8..531dcb4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -4,11 +4,11 @@ set -e # Commands this script needs needed='rm mkdir autoreconf echo' -if ! type $needed >/dev/null +if ! type $needed >/dev/null 2>&1 then for cmd in $needed do - if ! type $cmd >/dev/null + if ! type $cmd >/dev/null 2>&1 then # Have type print an error message for each missing command type $cmd || true