changeset 22820:78ee2ec009e8

Make error output during autogen actually readable...
author Gary Kramlich <grim@reaperworld.com>
date Mon, 05 May 2008 02:00:28 +0000
parents a9141d049266
children 61e0bcbf31ab
files autogen.sh
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/autogen.sh	Mon May 05 00:02:37 2008 +0000
+++ b/autogen.sh	Mon May 05 02:00:28 2008 +0000
@@ -79,17 +79,23 @@
 	CMD=$1
 	shift
 
+	OUTPUT=`mktemp autogen-XXXX`
+
 	printf "%s" "running ${CMD} ${@}... "
-	OUTPUT=`${CMD} ${@} 2>&1`
+	${CMD} ${@} >${OUTPUT} 2>&1
+
 	if [ $? != 0 ] ; then
 		echo "failed."
-		echo ${OUTPUT}
+		cat ${OUTPUT}
+		rm -f ${OUTPUT}
 		exit 1
 	else
 		echo "done."
-		if [ x"${OUTPUT}" != x"" ] ; then
-			echo ${OUTPUT}
+		if [ `stat --printf="%s" ${OUTPUT}` -ge 0 ] ; then
+			cat ${OUTPUT}
 		fi
+
+		rm -f ${OUTPUT}
 	fi
 }