From 5c6d98857c45eb0654166339d47e7360c9adc62f Mon Sep 17 00:00:00 2001 From: Derek Ross Date: Sat, 7 Nov 2026 09:17:04 -0500 Subject: [PATCH] omamobile-omarchy 0.1.34: omamobile-update check refuses an update pacman can't plan (#433) omamobile-update check asks pacman for the whole update's plan (pacman -Sup) to see what it would install, but it ignored a failed plan and fell back to checkupdates' plain list. So when the plan can't be made, check said ok and the update sheet offered an update that then stopped partway. On #433, a phone installed before 2026-11-03 hit this: [omarchy]'s aquamarine 0.15.1 lacks the libaquamarine.so=15 our Hyprland needs. A failed plan, or one that can't run, is now a blocker that quotes pacman's own error lines. A test feeds the fake pacman #433's real message and checks the refusal and the reason; with the old code it fails. The package's test/all: 230 ok. Co-Authored-By: Claude Opus 5.5 --- docs/RELEASES.md | 2 +- .../omamobile-omarchy/bin/omamobile-update | 20 +++++++++++++------ packages/omamobile-omarchy/test/update.sh | 11 +++++++++- packages/omamobile-omarchy/version | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 2cfeeb857..2937eaa4d 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -212,7 +212,7 @@ The same Alpine-based initramfs, with release differences: | --- | --- | | transcript (`script` to `/tmp/omarchy-update.log`) | kept; `omamobile-update` makes the pty itself, so one sudo timestamp covers the whole run | | update lock, 10 GiB free-space check | kept | -| `omarchy-update-confirm` (gum) | replaced by the sheet's Update button, plus refusals: battery below 30% unless charging; `[omamobile]` not first or `[omarchy]` after Arch Linux ARM's repositories; another distribution's kernel, a bootloader, Snapper or fwupd package in the transaction; `linux-omamobile` when `omamobile-boot-update preflight` says its hook would refuse to write slot B | +| `omarchy-update-confirm` (gum) | replaced by the sheet's Update button, plus refusals: battery below 30% unless charging; `[omamobile]` not first or `[omarchy]` after Arch Linux ARM's repositories; another distribution's kernel, a bootloader, Snapper or fwupd package in the transaction; `linux-omamobile` when `omamobile-boot-update preflight` says its hook would refuse to write slot B; an update pacman can't plan (`pacman -Sup` fails, as with an unsatisfiable dependency), with pacman's reason | | `omarchy-update-pkg-prune` (paccache) | kept | | `omarchy-snapshot create` (Snapper, Limine's snapshot menu) | skipped: ext4 root, no Snapper (exit 127, which Omarchy takes for "Snapper absent") | | stay-awake inhibitor | kept (the screen stays on during the update) | diff --git a/packages/omamobile-omarchy/bin/omamobile-update b/packages/omamobile-omarchy/bin/omamobile-update index ee61fcbe2..3e2023b29 100755 --- a/packages/omamobile-omarchy/bin/omamobile-update +++ b/packages/omamobile-omarchy/bin/omamobile-update @@ -413,15 +413,23 @@ def pending_updates(offline=False): db = os.environ.get("CHECKUPDATES_DB") or os.path.join(os.environ.get("TMPDIR") or "/tmp", "checkup-db-%d" % os.getuid()) targets = [] if lines: + # pacman's plan of the whole update: when it can't be made (a dependency + # no repository satisfies, a conflict), the update would stop in the + # middle, so refuse it here with pacman's own reason (#433) try: plan = subprocess.run([PACMAN, "-Sup", "--dbpath", db, "--logfile", "/dev/null", "--print-format", "%n %v"], capture_output=True, text=True, timeout=120) - for l in plan.stdout.splitlines(): - parts = l.split() - if len(parts) == 2 and not l.startswith(("::", "warning", "error")): - targets.append((parts[0], parts[1])) - except (OSError, subprocess.TimeoutExpired): - pass + except (OSError, subprocess.TimeoutExpired) as e: + return lines, [], "could not plan the update: %s" % e + if plan.returncode != 0: + why = [l.strip() for l in (plan.stderr + "\n" + plan.stdout).splitlines() + if l.strip().startswith(("error", "::"))] + return lines, [], "pacman can't plan this update, so it would stop partway: %s" % ( + "; ".join(why[:4]) or "pacman -Sup exited %d" % plan.returncode) + for l in plan.stdout.splitlines(): + parts = l.split() + if len(parts) == 2 and not l.startswith(("::", "warning", "error")): + targets.append((parts[0], parts[1])) if not targets: targets = [(l.split()[0], l.split()[-1]) for l in lines] return lines, targets, "" diff --git a/packages/omamobile-omarchy/test/update.sh b/packages/omamobile-omarchy/test/update.sh index f0aad3820..6051955cf 100755 --- a/packages/omamobile-omarchy/test/update.sh +++ b/packages/omamobile-omarchy/test/update.sh @@ -56,7 +56,7 @@ cat >"$fake/pacman" </dev/null ;; + -Sup) if [[ -s "$t/plan-fail" ]]; then cat "$t/plan-fail" >&2; exit 1; fi; cat "$t/plan" 2>/dev/null ;; -Qmq) echo some-aur-thing ;; -Qtdq) echo orphan-lib ;; *) echo "pacman \$*" >>"$calls" ;; @@ -201,6 +201,15 @@ printf 'omarchy 4.0.5-1\nlinux-aarch64 7.3-1\nlimine 9.0-1\nlinux-firmware-other out=$(python3 -I "$U" check --json) ok "check: kernels and bootloaders in the plan block, firmware and headers don't" 'python3 -c "import json,sys; d=json.loads(sys.argv[1]); assert d[\"boot_packages\"] == [\"limine\", \"linux-aarch64\"] and not d[\"ok\"]" "$out"' printf 'omarchy 4.0.5-1\nmesa 26.1-1\n' >"$t/plan" +# A plan pacman can't make (#433: [omarchy]'s aquamarine 0.15.1 without the so=15 +# our Hyprland needs) is a refusal with pacman's reason, never the plain list +printf "error: failed to prepare transaction (could not satisfy dependencies)\n:: unable to satisfy dependency 'libaquamarine.so=15-64' required by hyprland\n" >"$t/plan-fail" +out=$(python3 -I "$U" check --json) +ok "check: a plan pacman can't make blocks, with pacman's reason" 'python3 -c " +import json,sys; d=json.loads(sys.argv[1]); b=\" \".join(d[\"blockers\"]) +assert not d[\"ok\"] and \"can\x27t plan this update\" in b and \"libaquamarine.so=15-64\" in b, d[\"blockers\"] +" "$out"' +rm -f "$t/plan-fail" # The phone's own kernel package goes through omamobile-boot-update printf 'omarchy 4.0.5-1\nlinux-omamobile 7.3.0rc6.r453.g0123456789ab-1\nomamobile-boot-update 0.1.0-1\n' >"$t/plan" diff --git a/packages/omamobile-omarchy/version b/packages/omamobile-omarchy/version index 50140e353..9dd179330 100644 --- a/packages/omamobile-omarchy/version +++ b/packages/omamobile-omarchy/version @@ -1 +1 @@ -0.1.33 +0.1.34