comparison autogen.sh @ 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 7291da73b054
children 5513f1f5f4bc 1dd0e007514d
comparison
equal deleted inserted replaced
22819:a9141d049266 22820:78ee2ec009e8
77 77
78 run_or_die () { # beotch 78 run_or_die () { # beotch
79 CMD=$1 79 CMD=$1
80 shift 80 shift
81 81
82 OUTPUT=`mktemp autogen-XXXX`
83
82 printf "%s" "running ${CMD} ${@}... " 84 printf "%s" "running ${CMD} ${@}... "
83 OUTPUT=`${CMD} ${@} 2>&1` 85 ${CMD} ${@} >${OUTPUT} 2>&1
86
84 if [ $? != 0 ] ; then 87 if [ $? != 0 ] ; then
85 echo "failed." 88 echo "failed."
86 echo ${OUTPUT} 89 cat ${OUTPUT}
90 rm -f ${OUTPUT}
87 exit 1 91 exit 1
88 else 92 else
89 echo "done." 93 echo "done."
90 if [ x"${OUTPUT}" != x"" ] ; then 94 if [ `stat --printf="%s" ${OUTPUT}` -ge 0 ] ; then
91 echo ${OUTPUT} 95 cat ${OUTPUT}
92 fi 96 fi
97
98 rm -f ${OUTPUT}
93 fi 99 fi
94 } 100 }
95 101
96 ############################################################################### 102 ###############################################################################
97 # We really start here, yes, very sneaky! 103 # We really start here, yes, very sneaky!