From 277fa7be97f4bf3cacf4445932f870ba1cdbf152 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 8 Nov 2023 08:58:52 +0100 Subject: [PATCH] composite: make 'watch' more usable and add a small documentation --- README.md | 6 ++++++ composite/watch.sh | 30 +++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ab1de97..48a8cb6 100644 --- a/README.md +++ b/README.md @@ -462,6 +462,12 @@ A fully contained nightly build for the system is invoked using: # make nightly +When nightly builds are being run you can get a brief report of +the latest one for each build step or select a build step to either +view the file or watch it run in real time: + + # make watch[-] + To allow the nightly build to build both release and development packages use: diff --git a/composite/watch.sh b/composite/watch.sh index c338235..b000dbf 100644 --- a/composite/watch.sh +++ b/composite/watch.sh @@ -36,11 +36,27 @@ if [ -z "${CURRENTDIR}" ]; then fi if [ -z "${LOGSTEP}" ]; then - find ${CURRENTDIR} -name "*.log" - return + echo nightly build $(basename ${CURRENTDIR}) + echo ========================== + for CURRENTLOG in $(find -s ${CURRENTDIR} -name "*.log"); do + CURRENTRET=running + if [ -f ${CURRENTLOG}.ok ]; then + CURRENTRET=ok + elif [ -f ${CURRENTLOG}.err ]; then + CURRENTRET=error + fi + CURRENTLOG=${CURRENTLOG#"${CURRENTDIR}/"} + CURRENTLOG=${CURRENTLOG%.log} + CURRENTLOG=${CURRENTLOG#*-} + echo ${CURRENTLOG}: ${CURRENTRET} + done +else + for CURRENTLOG in $(find ${CURRENTDIR} -name "??-${LOGSTEP}.log"); do + if [ -f ${CURRENTLOG}.ok -o -f ${CURRENTLOG}.err ]; then + less ${CURRENTLOG} + else + tail -f ${CURRENTLOG} + fi + break + done fi - -for CURRENTLOG in $(find ${CURRENTDIR} -name "??-${LOGSTEP}.log"); do - tail -f ${CURRENTLOG} - break -done