← Commit history

1.3.3: name the failing update leg in the banner (adom/hook#5). The status file now records which leg failed (sweep vs core-install) and the banner prints the matching retry command; the old static remedy said 'pkg install adom/core' even when that leg had succeeded and the sweep was what broke.

Colby Knox ·0738f4a39e ·1mo ago ·parent 945975e
2 files changed +23−5
check-updates.sh+22−4
@@ -69,7 +69,24 @@ if [ -f "$STATUS" ]; then   # is not re-reported here as a failed update.   if [ "$st" != "running" ] && [ "$st" != "cli-missing" ] && [ -n "$st" ] && [ "$st" != "0" ]; then     reason="$(tail -n 3 "$LOG" 2>/dev/null | tr '\n' ' ' | cut -c1-300)"-    echo "adom: the last background auto-update FAILED (exit $st) -- the fleet may be behind wiki.adom.inc. See why with 'adom-wiki pkg install adom/core'. Recent output: ${reason:-<none>}"+    # The status may carry which LEG failed ("<code> sweep" | "<code> core-install",+    # written below since 1.3.3). Name the failing leg and its matching retry+    # command: the old banner always said 'pkg install adom/core', which misled+    # when core was fine and the SWEEP was what broke (adom/hook#5).+    code="${st%% *}"+    leg=""+    case "$st" in *" "*) leg="${st#* }" ;; esac+    case "$leg" in+      sweep)+        echo "adom: the last background auto-update's PACKAGE SWEEP failed (exit $code); adom/core itself is current, but non-core packages may be drifting behind wiki.adom.inc. See why with 'adom-wiki pkg update'. Recent output: ${reason:-<none>}"+        ;;+      core-install)+        echo "adom: the last background auto-update FAILED installing adom/core (exit $code) -- the fleet may be behind wiki.adom.inc. See why with 'adom-wiki pkg install adom/core'. Recent output: ${reason:-<none>}"+        ;;+      *)+        echo "adom: the last background auto-update FAILED (exit $st) -- the fleet may be behind wiki.adom.inc. See why with 'adom-wiki pkg install adom/core'. Recent output: ${reason:-<none>}"+        ;;+    esac     # Fall through and retry below; a transient failure self-heals, a real one     # (a deleted dependency) keeps surfacing here until it is fixed at the source.   fi@@ -138,9 +155,10 @@ echo running > "$STATUS" 2>/dev/null   adom-wiki pkg install adom/core >> "$LOG" 2>&1   i=$?   rc=0-  [ "$u" -ne 0 ] && rc="$u"-  [ "$i" -ne 0 ] && rc="$i"-  echo "$rc" > "$STATUS" 2>/dev/null+  leg=""+  [ "$u" -ne 0 ] && { rc="$u"; leg="sweep"; }+  [ "$i" -ne 0 ] && { rc="$i"; leg="core-install"; }+  echo "$rc${leg:+ $leg}" > "$STATUS" 2>/dev/null ) </dev/null >/dev/null 2>&1 & disown 2>/dev/null 
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "hook",-  "version": "1.3.2",+  "version": "1.3.3",   "type": "app",   "org": "adom",   "bundled": true,