org.guifications.plugins.buildsystem_rewrite: 7509f23a73e0056f2eaffcf41a1a7d855c8e36a1

grim at guifications.org grim at guifications.org
Sun Apr 20 22:25:08 CDT 2008


-----------------------------------------------------------------
Revision: 7509f23a73e0056f2eaffcf41a1a7d855c8e36a1
Ancestor: 6536b2542cbe10cb95d86d0a50c57afa0184a13c
Author: grim at guifications.org
Date: 2008-04-21T02:48:37
Branch: org.guifications.plugins.buildsystem_rewrite

Modified files:
        autogen.sh

ChangeLog: 

Fixed output for failed run_or_die's
Added stu's fix for making which quieter


-----------------------------------------------------------------
This revision's diffstat output:
 autogen.sh |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
-------------- next part --------------
============================================================
--- autogen.sh	2c862c5baa74bc48a484a77a852ec5ac0d3d1667
+++ autogen.sh	3f0a0621283a72ddf5352e2c9028d48d383b8889
@@ -55,7 +55,7 @@ check () {
 	CMD=$1
 
 	echo -n "checking for ${CMD}... "
-	BIN=`which ${CMD}`
+	BIN=`which ${CMD} 2>/dev/null`
 
 	if [ x"${BIN}" = x"" ] ; then
 		echo "not found."
@@ -70,17 +70,23 @@ run_or_die () { # beotch
 	CMD=$1
 	shift
 
+	OUTPUT=`mktemp autogen-XXXX`
+
 	echo -n "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
 }
 


More information about the Plugins-commits mailing list