diff --git a/AGENTS.md b/AGENTS.md index d90046f1..6abcc44b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -188,6 +188,6 @@ New migration format: - Use `$OMARCHY_PATH` to reference the omarchy directory - Prefer helper commands such as `omarchy-cmd-present`, `omarchy-cmd-missing`, `omarchy-pkg-present`, and `omarchy-pkg-missing` -Omarchy 4.0 is upgraded through `bin/omarchy-upgrade-to-4`, not through the normal migration runner. Do not add compatibility migrations for old installer layouts; put pre-4 package-layout transition work in the upgrade command instead. +Omarchy 4.0 is upgraded through `bin/omarchy-upgrade-to-quattro`, not through the normal migration runner. Do not add compatibility migrations for old installer layouts; put pre-4 package-layout transition work in the upgrade command instead. Migrations may use raw `pacman`, `command -v`, or direct config edits when needed for one-off repair work. diff --git a/bin/omarchy-upgrade-to-4 b/bin/omarchy-upgrade-to-quattro similarity index 98% rename from bin/omarchy-upgrade-to-4 rename to bin/omarchy-upgrade-to-quattro index a7c62183..65d0ccad 100755 --- a/bin/omarchy-upgrade-to-4 +++ b/bin/omarchy-upgrade-to-quattro @@ -2,14 +2,14 @@ # omarchy:summary=Upgrade a legacy Omarchy install to the package-backed Omarchy 4 layout. # omarchy:args=[--yes] [--reboot] [--dev] [--channel stable|rc|edge] [--user USER] -# omarchy:examples=omarchy upgrade to 4 | omarchy upgrade to 4 --dev +# omarchy:examples=omarchy upgrade to quattro | omarchy upgrade to quattro --dev # omarchy:requires-sudo=true set -euo pipefail usage() { cat <<'USAGE' -Usage: omarchy-upgrade-to-4 [--yes] [--reboot] [--dev] [--channel stable|rc|edge] [--user USER] +Usage: omarchy-upgrade-to-quattro [--yes] [--reboot] [--dev] [--channel stable|rc|edge] [--user USER] Upgrade any pre-4 Omarchy install to the package-backed Omarchy 4 layout. This script is intentionally self-contained so it can be shipped as a command @@ -342,7 +342,7 @@ configure_pacman_channel() { as_root install -d -m 0755 /etc/pacman.d if [[ -f /etc/pacman.d/mirrorlist ]]; then - as_root cp -f /etc/pacman.d/mirrorlist "/etc/pacman.d/mirrorlist.omarchy-upgrade-to-4.$backup_suffix.bak" + as_root cp -f /etc/pacman.d/mirrorlist "/etc/pacman.d/mirrorlist.omarchy-upgrade-to-quattro.$backup_suffix.bak" fi printf 'Server = %s\n' "$mirror_server" | as_root tee /etc/pacman.d/mirrorlist >/dev/null @@ -350,7 +350,7 @@ configure_pacman_channel() { fail "/etc/pacman.conf does not exist." fi - as_root cp -f /etc/pacman.conf "/etc/pacman.conf.omarchy-upgrade-to-4.$backup_suffix.bak" + as_root cp -f /etc/pacman.conf "/etc/pacman.conf.omarchy-upgrade-to-quattro.$backup_suffix.bak" # Replace the normal Omarchy package repository. Dev package mode uses the # edge channel and resolves omarchy-dev / omarchy-settings-dev from [omarchy]. @@ -759,8 +759,8 @@ populate_legacy_hypr_defaults() { create_live_omarchy_overlay() { local backup="$1" compat_root shim_hypr_dir entry base cleanup_hook - compat_root="$TARGET_HOME/.local/state/omarchy/upgrade-to-4-live-omarchy" - shim_hypr_dir="$TARGET_HOME/.local/state/omarchy/upgrade-to-4-hypr-defaults" + compat_root="$TARGET_HOME/.local/state/omarchy/upgrade-to-quattro-live-omarchy" + shim_hypr_dir="$TARGET_HOME/.local/state/omarchy/upgrade-to-quattro-hypr-defaults" populate_legacy_hypr_defaults "$shim_hypr_dir" "$backup" || return 1 @@ -782,7 +782,7 @@ create_live_omarchy_overlay() { done ln -s "$shim_hypr_dir" "$compat_root/default/hypr" - cleanup_hook="$TARGET_HOME/.config/omarchy/hooks/post-boot.d/cleanup-upgrade-to-4-live-shim" + cleanup_hook="$TARGET_HOME/.config/omarchy/hooks/post-boot.d/cleanup-upgrade-to-quattro-live-shim" mkdir -p "$(dirname "$cleanup_hook")" cat >"$cleanup_hook" <.sh omarchy-migrate ``` -Omarchy 4.0 is upgraded through `bin/omarchy-upgrade-to-4`, not through the +Omarchy 4.0 is upgraded through `bin/omarchy-upgrade-to-quattro`, not through the normal migration runner. Do not add compatibility migrations for old installer layouts; put pre-4 package-layout transition work in the upgrade command instead. diff --git a/migrations/1782002156.sh b/migrations/1782002156.sh index 2fc1010d..7ed9d0a8 100644 --- a/migrations/1782002156.sh +++ b/migrations/1782002156.sh @@ -41,7 +41,7 @@ networkd_units=( systemd-networkd-resolve-hook.socket ) -if [[ ${OMARCHY_UPGRADE_TO_4_LIVE:-0} == "1" ]]; then +if [[ ${OMARCHY_UPGRADE_TO_QUATTRO_LIVE:-0} == "1" ]]; then as_root systemctl enable NetworkManager.service >/dev/null 2>&1 || true if systemctl is-active --quiet NetworkManager.service 2>/dev/null; then diff --git a/test/shell.d/config-test.sh b/test/shell.d/config-test.sh index 7143a205..bda8ab55 100755 --- a/test/shell.d/config-test.sh +++ b/test/shell.d/config-test.sh @@ -300,7 +300,7 @@ jq -e ' ' "$TMPDIR/home/.config/omarchy/shell.json" >/dev/null pass "shell config removes widgets with remove alias" -if grep -RIl 'upgrade-to-4\|Omarchy 4\.0 is upgraded' "$ROOT/migrations" >/dev/null; then +if grep -RIl 'upgrade-to-quattro\|Omarchy 4\.0 is upgraded' "$ROOT/migrations" >/dev/null; then fail "4.0 upgrade is not modeled as a migration" fi pass "4.0 upgrade is handled outside the migration runner" diff --git a/test/shell.d/hyprland-default-config-test.sh b/test/shell.d/hyprland-default-config-test.sh index 7fa10f24..fabd5f2f 100644 --- a/test/shell.d/hyprland-default-config-test.sh +++ b/test/shell.d/hyprland-default-config-test.sh @@ -157,12 +157,12 @@ cmp -s "$ROOT/config/hypr/bindings.lua" "$migration_home/.config/hypr/bindings.l fail "plain legacy bindings preserve preinstall removal state" pass "migration converts plain legacy bindings to package-owned defaults" -upgrade_script="$ROOT/bin/omarchy-upgrade-to-4" +upgrade_script="$ROOT/bin/omarchy-upgrade-to-quattro" grep -Fq 'touch "$state_dir/preinstalls-removed"' "$upgrade_script" || - fail "upgrade-to-4 preserves preinstall removal state" + fail "upgrade-to-quattro preserves preinstall removal state" mark_line=$(awk '/^mark_removed_preinstalls_from_legacy_bindings$/ { print NR; exit }' "$upgrade_script") copy_line=$(awk '/^copy_always_config_defaults$/ { print NR; exit }' "$upgrade_script") -[[ -n $mark_line && -n $copy_line ]] || fail "upgrade-to-4 preinstall marker and config refresh calls exist" -(( mark_line < copy_line )) || fail "upgrade-to-4 detects plain legacy bindings before overwriting Hyprland bindings" -pass "upgrade-to-4 preserves preinstall removal before refreshing Hyprland bindings" +[[ -n $mark_line && -n $copy_line ]] || fail "upgrade-to-quattro preinstall marker and config refresh calls exist" +(( mark_line < copy_line )) || fail "upgrade-to-quattro detects plain legacy bindings before overwriting Hyprland bindings" +pass "upgrade-to-quattro preserves preinstall removal before refreshing Hyprland bindings" diff --git a/test/shell.d/network-manager-transition-test.sh b/test/shell.d/network-manager-transition-test.sh index c1ec496a..44154a64 100644 --- a/test/shell.d/network-manager-transition-test.sh +++ b/test/shell.d/network-manager-transition-test.sh @@ -27,7 +27,7 @@ grep -F '20-wlan.network' "$hardware_network" >/dev/null grep -F 'omarchy-networkd-retired' "$hardware_network" >/dev/null pass "hardware setup retires archinstall networkd state" -grep -F 'OMARCHY_UPGRADE_TO_4_LIVE' "$migration" >/dev/null +grep -F 'OMARCHY_UPGRADE_TO_QUATTRO_LIVE' "$migration" >/dev/null grep -F 'systemctl disable --now "$unit"' "$migration" >/dev/null grep -F 'systemctl stop systemd-networkd.service' "$migration" >/dev/null grep -F 'NetworkManager.service' "$migration" >/dev/null diff --git a/test/shell.d/systemd-test.sh b/test/shell.d/systemd-test.sh index 6aa5d18e..673ede39 100755 --- a/test/shell.d/systemd-test.sh +++ b/test/shell.d/systemd-test.sh @@ -21,9 +21,9 @@ grep -Fx 'systemctl --user daemon-reload' "$first_run_units" >/dev/null grep -F 'omarchy-sleep-lock.service' "$first_run_units" >/dev/null pass "first-run reloads and enables the sleep lock service" -upgrade_to_4="$ROOT/bin/omarchy-upgrade-to-4" -grep -F '6870b232a6c0474b59187882e6d25ae771bba735098bcbedef8a2b73b97e2b6a' "$upgrade_to_4" >/dev/null -grep -F 'ExecStart=%h/.local/share/omarchy/bin/omarchy-system-sleep-monitor' "$upgrade_to_4" >/dev/null -grep -F 'ExecStart=/usr/bin/omarchy-system-sleep-monitor' "$upgrade_to_4" >/dev/null -grep -F 'reset-failed omarchy-sleep-lock.service' "$upgrade_to_4" >/dev/null +upgrade_to_quattro="$ROOT/bin/omarchy-upgrade-to-quattro" +grep -F '6870b232a6c0474b59187882e6d25ae771bba735098bcbedef8a2b73b97e2b6a' "$upgrade_to_quattro" >/dev/null +grep -F 'ExecStart=%h/.local/share/omarchy/bin/omarchy-system-sleep-monitor' "$upgrade_to_quattro" >/dev/null +grep -F 'ExecStart=/usr/bin/omarchy-system-sleep-monitor' "$upgrade_to_quattro" >/dev/null +grep -F 'reset-failed omarchy-sleep-lock.service' "$upgrade_to_quattro" >/dev/null pass "Omarchy 4 upgrade repairs the legacy sleep lock unit path" diff --git a/test/shell.d/upgrade-to-4-test.sh b/test/shell.d/upgrade-to-4-test.sh deleted file mode 100644 index b3210f91..00000000 --- a/test/shell.d/upgrade-to-4-test.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" - -upgrade_to_4="$ROOT/bin/omarchy-upgrade-to-4" -first_run_wifi="$ROOT/install/user/first-run/wifi.sh" - -grep -F 'pacman -Syu --needed' "$upgrade_to_4" >/dev/null -grep -F 'omarchy-update-aur-pkgs' "$upgrade_to_4" >/dev/null -grep -F 'omarchy-update-available' "$upgrade_to_4" >/dev/null -grep -F 'omarchy-update-mise' "$upgrade_to_4" >/dev/null -grep -F 'run_final_system_package_upgrade' "$upgrade_to_4" >/dev/null -pass "Omarchy 4 upgrade completes package update checks" - -grep -F 'run_post_upgrade_migrations' "$upgrade_to_4" >/dev/null -grep -F 'omarchy-migrate' "$upgrade_to_4" >/dev/null -grep -F 'dust' "$upgrade_to_4" >/dev/null -grep -F 'satty' "$upgrade_to_4" >/dev/null -pass "Omarchy 4 upgrade applies packaged migrations" - -grep -F 'skip-first-run-update-notification' "$upgrade_to_4" >/dev/null -grep -F 'skip-first-run-update-notification' "$first_run_wifi" >/dev/null -grep -F '(( skip_update_notification )) && return 0' "$first_run_wifi" >/dev/null -pass "Omarchy 4 upgrade suppresses the fresh-install update toast" - -grep -F 'configure_snapper_policy' "$upgrade_to_4" >/dev/null -grep -F '/usr/share/omarchy/install/config/snapper.sh' "$upgrade_to_4" >/dev/null -grep -F 'bash -euo pipefail "$snapper_config_script"' "$upgrade_to_4" >/dev/null -pass "Omarchy 4 upgrade normalizes Snapper retention" - -grep -F 'OMARCHY_UPGRADE_TO_4_LIVE=1' "$upgrade_to_4" >/dev/null -grep -F 'systemd-networkd.service' "$upgrade_to_4" >/dev/null -grep -F 'systemd-networkd.socket' "$upgrade_to_4" >/dev/null -grep -F 'systemd-networkd-resolve-hook.socket' "$upgrade_to_4" >/dev/null -pass "Omarchy 4 upgrade retires systemd-networkd for NetworkManager" diff --git a/test/shell.d/upgrade-to-quattro-test.sh b/test/shell.d/upgrade-to-quattro-test.sh new file mode 100644 index 00000000..ae6f3cfe --- /dev/null +++ b/test/shell.d/upgrade-to-quattro-test.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +set -euo pipefail + +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" + +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 +grep -F 'omarchy-update-mise' "$upgrade_to_quattro" >/dev/null +grep -F 'run_final_system_package_upgrade' "$upgrade_to_quattro" >/dev/null +pass "Omarchy 4 upgrade completes package update checks" + +grep -F 'run_post_upgrade_migrations' "$upgrade_to_quattro" >/dev/null +grep -F 'omarchy-migrate' "$upgrade_to_quattro" >/dev/null +grep -F 'dust' "$upgrade_to_quattro" >/dev/null +grep -F 'satty' "$upgrade_to_quattro" >/dev/null +pass "Omarchy 4 upgrade applies packaged migrations" + +grep -F 'skip-first-run-update-notification' "$upgrade_to_quattro" >/dev/null +grep -F 'skip-first-run-update-notification' "$first_run_wifi" >/dev/null +grep -F '(( skip_update_notification )) && return 0' "$first_run_wifi" >/dev/null +pass "Omarchy 4 upgrade suppresses the fresh-install update toast" + +grep -F 'configure_snapper_policy' "$upgrade_to_quattro" >/dev/null +grep -F '/usr/share/omarchy/install/config/snapper.sh' "$upgrade_to_quattro" >/dev/null +grep -F 'bash -euo pipefail "$snapper_config_script"' "$upgrade_to_quattro" >/dev/null +pass "Omarchy 4 upgrade normalizes Snapper retention" + +grep -F 'OMARCHY_UPGRADE_TO_QUATTRO_LIVE=1' "$upgrade_to_quattro" >/dev/null +grep -F 'systemd-networkd.service' "$upgrade_to_quattro" >/dev/null +grep -F 'systemd-networkd.socket' "$upgrade_to_quattro" >/dev/null +grep -F 'systemd-networkd-resolve-hook.socket' "$upgrade_to_quattro" >/dev/null +pass "Omarchy 4 upgrade retires systemd-networkd for NetworkManager"