legacy/libisoburn/trunk/releng/run_all_releng

68 lines
1.2 KiB
Plaintext
Raw Normal View History

2011-06-26 14:06:38 +00:00
#!/bin/bash
set -e
SELF=`echo $0|sed -e 's/\.\///'`
CLOG1=log.$SELF.1
CLOG2=log.$SELF.2
2011-06-26 14:06:38 +00:00
2011-06-26 14:07:54 +00:00
> ${CLOG1}
> ${CLOG2}
2011-06-26 14:06:38 +00:00
PASSED_OPTIONS=""
if [ "${1}" == "-cleanup" ]; then
PASSED_OPTIONS="-cleanup"
elif [ "${1}" == "-rc" -a "${2}" == "-keep" ]; then
PASSED_OPTIONS="-rc -keep"
elif [ "${1}" == "-rc" ]; then
PASSED_OPTIONS="-rc"
else
cat << HLP
$0: $0 -rc [-keep]
$0: $0 -cleanup
HLP
exit 0
fi
2011-06-26 14:06:38 +00:00
main() {
2011-06-26 15:16:10 +00:00
#
DSTART=`date --utc`
printf "\n$0: Started at ${DSTART}"
E1=`date '+%s'`
# require ^releng_, avoid running (your)self explcitly
for s in `ls | grep ^releng_ | grep -v ${SELF} | sort`; do
if [ -x ${s} -a ! -d ${s} ]; then
printf "\n$0: Running ./${s} ${PASSED_OPTIONS}..."
2011-06-26 14:23:13 +00:00
T1=`date '+%s'`
2011-06-26 20:51:16 +00:00
set +e
./${s} ${PASSED_OPTIONS} 1>>${CLOG1} 2>>${CLOG2}
2011-06-26 14:06:38 +00:00
RET=$?
2011-06-26 14:23:13 +00:00
T2=`date '+%s'`
let TS="${T2}-${T1}"
2011-06-26 20:51:16 +00:00
case ${RET} in
0)
printf "done in ${TS} sec. ok."
;;
*)
printf "done in ${TS} sec. FAILED WITH EXIT CODE: $RET;"
;;
esac
2011-06-26 14:06:38 +00:00
set -e
fi
done
2011-06-26 15:16:10 +00:00
DEND=`date --utc`
printf "\n$0: Finished at ${DEND}.\n"
2011-06-26 15:16:10 +00:00
E2=`date '+%s'`
let ES="${E2}-${E1}"
printf "\n$0: Total time elapsed ${ES} sec."
2011-06-26 20:57:22 +00:00
printf "\n$0: Results saved in ${CLOG1} and ${CLOG2}.\n\n"
2011-06-26 15:16:10 +00:00
#
2011-06-26 14:06:38 +00:00
exit 0
}
#
main