From 40c5fb8e988677119b6a1e0bba651b813990efee Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Sat, 10 Oct 2026 00:46:10 +0200 Subject: [PATCH] Upgrade test: an older offer is nothing to upgrade to either, and show a stuck reboot by itself The early stop compared the offered version with the installed one for equality. Started from a release newer than the channel holds, the test went on to the updater with nothing to install. It now asks pacman's vercmp and stops when the offer is the same or older. The picture of a reboot that stuck was inside the condition that wants both the before and the after picture, so it was left out exactly when there was no after to show. It now has its own condition. --- .github/workflows/upgrade-test.yml | 14 ++++++++------ test/upgrade-test | 11 +++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/upgrade-test.yml b/.github/workflows/upgrade-test.yml index 638fc13..c86a40c 100644 --- a/.github/workflows/upgrade-test.yml +++ b/.github/workflows/upgrade-test.yml @@ -200,12 +200,14 @@ jobs: echo "| Before, $FROM | After, on $TO |" echo "| --- | --- |" echo "| ![before]($PICTURES/before.png) | ![after]($PICTURES/after.png) |" - if [ -s evidence/stuck.png ]; then - echo - echo "The reboot did not come back by itself. This is what the screen showed:" - echo - echo "![stuck]($PICTURES/stuck.png)" - fi + fi + # The picture of a reboot that stuck stands by itself: it is the + # one worth having when there is no "after" to show. + if [ -n "$PICTURES" ] && [ -s evidence/stuck.png ]; then + echo + echo "The reboot did not come back by itself. This is what the screen showed:" + echo + echo "![stuck]($PICTURES/stuck.png)" fi echo echo "[Run $GITHUB_RUN_ID]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID), attempt $GITHUB_RUN_ATTEMPT, at \`${GITHUB_SHA:0:7}\`." diff --git a/test/upgrade-test b/test/upgrade-test index 34d4148..729127e 100755 --- a/test/upgrade-test +++ b/test/upgrade-test @@ -148,14 +148,17 @@ for migration in ${EXTRA_MIGRATIONS:-}; do ssh "${ssh_opts[@]}" omarchy@127.0.0.1 "sudo tee /usr/share/omarchy/migrations/$(basename "$migration") >/dev/null" <"$migration" done -# A channel that offers what the machine already has is no upgrade. Say so -# now: the release's own updater, run with nothing to do, ends at a prompt -# nobody is there to answer. +# A channel that offers what the machine already has, or something older, is +# no upgrade. Say so now: the release's own updater, run with nothing to do, +# ends at a prompt nobody is there to answer. case $channel in edge) package=omarchy-dev ;; *) package=omarchy ;; esac offered=$(guest "curl -fsSL --retry 3 https://pkgs.omarchy.org/$channel/\$(uname -m)/omarchy.db | bsdtar -xOf - '$package-[0-9]*/desc' | sed -n '/^%VERSION%\$/{n;p;}'" 2>/dev/null | head -n 1) installed=$(guest "pacman -Q $package 2>/dev/null | cut -d' ' -f2" 2>/dev/null) log "The $channel channel offers $package ${offered:-nothing}; installed: ${installed:-none}" -if [[ -z $offered || $offered == "$installed" ]]; then +# pacman's own ordering: 0 for the same version, below 0 for an older offer. +newer=1 +[[ -z $installed ]] || newer=$(guest "vercmp $(printf %q "${offered:-0}") $(printf %q "$installed")" 2>/dev/null) +if [[ -z $offered ]] || (( ${newer:-0} <= 0 )); then { echo "**Nothing to upgrade to.** The $channel channel offers \`$package ${offered:-nothing}\`, and the machine has \`$(fact "$out/before.txt" omarchy)\`." echo