slight adjustment for last and previous run logs

This commit is contained in:
George Danchev 2011-12-15 14:14:17 +00:00
parent 35ffef5dbc
commit bf4404d647

View File

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