From d71d3f15eb08a86cb80f0ef1258037b21496faf3 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 8 Jun 2023 14:08:19 +0200 Subject: [PATCH] apply: report a bit more info during an update run this "splits" the output into sections so it's easier to attribute what is curretly run. useful for debugging failures. in the end, the script reports total CPU time it took to run the update. --- apply.sh | 11 +++++++++++ update.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apply.sh b/apply.sh index de1a43a..6a9facc 100755 --- a/apply.sh +++ b/apply.sh @@ -2,27 +2,38 @@ # the script executes updates to a nakamochi system. # it must be run as root or a user with equivalent privileges. +# at script exit, report system/user CPU times it took to run +# the whole update while preserving exit code. +trap times EXIT +# abort if an expansion encounteres an unset variable. +set -u + exit_code=0 # defined in the caller script rootdir="$SYSUPDATES_ROOTDIR" # base os +printf "######## base os\n" 1>&2 cd "$rootdir" ./base/voidlinux.sh || exit 1 +printf "######## tor\n" 1>&2 cd "$rootdir" ./base/tor.sh || exit_code=$? # nakamochi daemon and gui (ndg) +printf "######## ndg\n" 1>&2 cd "$rootdir" . ./ndg/env ndg_apply || exit_code=$? # bitcoin core +printf "######## bitcoind\n" 1>&2 cd "$rootdir" . ./btc/env bitcoin_apply || exit_code=$? # lnd lightning +printf "######## lnd\n" 1>&2 cd "$rootdir" . ./lnd/env lnd_apply || exit_code=$? diff --git a/update.sh b/update.sh index 2c927f1..8a57c06 100755 --- a/update.sh +++ b/update.sh @@ -30,7 +30,7 @@ fi # start of the sysupdate; trim prevously logged runs date > $LOGFILE -# fetch updates from remove +# fetch updates from remote cd "$REPODIR" { git fetch origin # in case the refspec is unknown locally yet