From 70af907ebe84d2f92364b64e693349b65b8c6fdf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 May 2017 18:43:55 +0200 Subject: Clean up buildos monitor diagnostics --- buildos | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'buildos') diff --git a/buildos b/buildos index 25029b0..8dfd3d3 100755 --- a/buildos +++ b/buildos @@ -473,11 +473,12 @@ function toolchain_checksum () # # Fetch a file from the sums file into $toolchain_root, verify its checksum, # and make a predictable name (without version) symlink. # -function toolchain_fetch () # +function toolchain_fetch () # { - local s p f u l tp tu tr tv + local s p f u l tn tp tu tr tv - tp="$1" + tn="$1" + tp="${toolchains["$tn"]}" tu="$(toolchain_value "$tp" toolchain_url)" tr="$(toolchain_value "$tp" toolchain_root)" @@ -503,7 +504,7 @@ function toolchain_fetch () # return 1 fi - info "toolchain version $tv" + info "toolchain '$tn' version $tv" declare -g "${tp}toolchain_fver=$tv" # Full version. echo "$tv" >"$tr/version-full" @@ -585,7 +586,7 @@ function toolchain_bootstrap () # fi for l in "${ls[@]}"; do - if ! toolchain_fetch "$tp" "$l"; then + if ! toolchain_fetch "$tn" "$l"; then return 2 # Diagnostics has already been issued. fi done @@ -737,12 +738,12 @@ function bbot_start () # # if ! bpkg build --build-option --jobs --build-option "$cpu_slice" \ --yes libbbot bbot; then - info "failed to build bbot agent" + info "failed to build bbot-agent@$tn" break fi if ! bpkg install "${vars[@]}" bbot; then - info "failed to install bbot agent" + info "failed to install bbot-agent@$tn" break fi @@ -796,7 +797,7 @@ function bbot_start () # print_diag 1>&2 if [ -n "$fail" ]; then - info "correct and start bbot agent (systemctl start bbot-agent@$tn)" + info "correct and start bbot-agent@$tn (systemctl start bbot-agent@$tn)" break fi fi @@ -864,11 +865,11 @@ while true; do cs="$(toolchain_checksum "$tp" "$f")" if [ "$ts" != "$cs" ]; then - email "rebooting because of new $tn toolchain" <&1 | tee "$tr/toolchain-$count.log" 1>&2 @@ -895,15 +896,15 @@ EOF tv="$(cat $tr/version-full)" declare "${tp}toolchain_fver=$tv" - s="bootstrapped $tn toolchain $tv" + s="bootstrapped '$tn' toolchain $tv" toolchain_boots+=("$tn") ;; 1) - s="skipping disabled $tn toolchain, waiting for new version" + s="skipping disabled '$tn' toolchain, waiting for new version" toolchain_boots+=("") # Skip. ;; *) - s="failed to bootstrap $tn toolchain, waiting for new version" + s="failed to bootstrap '$tn' toolchain, waiting for new version" toolchain_boots+=("") # Skip. ;; esac @@ -1019,7 +1020,7 @@ EOF fi ;; *) - s="failed to fetch package information for $tn, will try again" + s="failed to fetch package information for '$tn' toolchain, will try again" ;; esac -- cgit v1.1