slight adjustment for last and previous run logs

This commit is contained in:
George Danchev 2011-12-15 14:14:17 +00:00
parent 6bfcad1531
commit d30b0ef91e

View File

@ -9,6 +9,7 @@ set -e
SELF=$(basename "$0")
GEN_DATA_DIR=releng_generated_data
CLOG=${GEN_DATA_DIR}/log.${SELF}
CLOG_PREV=${CLOG}.prev
PASSED_OPTIONS="$@"
RELENG_XORRISO=
CLEANUP_LOG=0
@ -62,7 +63,8 @@ cat << HLP
${SELF} runs executables from releng directory starting with auto_*,
and passing them its own options. stdout/stderr output is stored in:
./${CLOG}
./${CLOG} (last run) and
./${CLOG_PREV} (previous run)
Usage: ${SELF} -x path/to/xorriso [-k] [-c] [-h]
-x absolute or relative path to xorriso binary to be run.
@ -119,7 +121,7 @@ fi
########################################################
if [ -f "${CLOG}" ]; then
mv "${CLOG}" "${CLOG}".prev
mv "${CLOG}" "${CLOG_PREV}"
fi
> ${CLOG}
if [ -x "${RELENG_XORRISO}" ]; then
@ -184,10 +186,10 @@ fi
echo # | tee -a ${CLOG}
echo -n "${SELF}: Removed my own log ${CLOG}." # | tee -a ${CLOG}
fi
if [ -f "${CLOG}".prev ]; then
rm -f "${CLOG}".prev
if [ -f "${CLOG_PREV}" ]; then
rm -f "${CLOG_PREV}"
echo # | tee -a ${CLOG}
echo "${SELF}: Removed my own log ${CLOG}.prev." # | tee -a ${CLOG}
echo "${SELF}: Removed my own log ${CLOG_PREV}." # | tee -a ${CLOG}
fi
else
E2=`date '+%s'`
@ -231,9 +233,9 @@ fi
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG}
##### TODO: work out a less noisy diff'ing technique!
if [ -f "${CLOG}".prev -a -f "${CLOG}" ]; then
if [ -f "${CLOG_PREV}" -a -f "${CLOG}" ]; then
echo "${SELF}: See diff against previous log file (might be long):" | tee -a ${CLOG}
echo "diff -Naur ${CLOG}.prev ${CLOG} | less" | tee -a ${CLOG}
echo "diff -Naur ${CLOG_PREV} ${CLOG} | less" | tee -a ${CLOG}
fi
fi