From 298e14071b683983419c548028cc1b30f9c8dc0c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 15 Jul 2026 17:08:17 -0700 Subject: [PATCH] Take a system snapshot before upgrading to quattro --- bin/omarchy-upgrade-to-quattro | 5 +++++ test/shell.d/upgrade-to-quattro-test.sh | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/bin/omarchy-upgrade-to-quattro b/bin/omarchy-upgrade-to-quattro index 97e827bd..6b12a042 100755 --- a/bin/omarchy-upgrade-to-quattro +++ b/bin/omarchy-upgrade-to-quattro @@ -475,6 +475,10 @@ configure_snapper_policy() { as_root env OMARCHY_PATH=/usr/share/omarchy bash -euo pipefail "$snapper_config_script" } +create_pre_upgrade_snapshot() { + omarchy-snapshot create || (($? == 127)) +} + remove_conflicting_legacy_packages() { # Remove legacy packages that are known to conflict with Omarchy quattro defaults # before the main package transaction. Broader retired-package cleanup runs @@ -2237,6 +2241,7 @@ refresh_current_theme_after_upgrade() { omarchy-restart-terminal >/dev/null 2>&1 || true } +create_pre_upgrade_snapshot configure_pacman_channel install_keyrings remove_legacy_installer_package diff --git a/test/shell.d/upgrade-to-quattro-test.sh b/test/shell.d/upgrade-to-quattro-test.sh index ae6f3cfe..1ef68cc0 100644 --- a/test/shell.d/upgrade-to-quattro-test.sh +++ b/test/shell.d/upgrade-to-quattro-test.sh @@ -7,6 +7,13 @@ source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" upgrade_to_quattro="$ROOT/bin/omarchy-upgrade-to-quattro" first_run_wifi="$ROOT/install/user/first-run/wifi.sh" +snapshot_line=$(grep -n '^create_pre_upgrade_snapshot$' "$upgrade_to_quattro" | cut -d: -f1) +pacman_line=$(grep -n '^configure_pacman_channel$' "$upgrade_to_quattro" | cut -d: -f1) +[[ -n $snapshot_line && -n $pacman_line ]] || fail "upgrade snapshot and first mutation calls exist" +(( snapshot_line < pacman_line )) || fail "upgrade snapshot runs before pacman configuration" +grep -F 'omarchy-snapshot create || (($? == 127))' "$upgrade_to_quattro" >/dev/null +pass "Omarchy 4 upgrade snapshots the system before mutation" + grep -F 'pacman -Syu --needed' "$upgrade_to_quattro" >/dev/null grep -F 'omarchy-update-aur-pkgs' "$upgrade_to_quattro" >/dev/null grep -F 'omarchy-update-available' "$upgrade_to_quattro" >/dev/null