From 7d5c19bf88c6c7b27a626245ecc7e1a021e58a82 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Fri, 20 Nov 2026 08:12:40 +0100 Subject: [PATCH] Fix periodic setup: source repo lib first require_extracted_repo ran before extracted_repos.sh was sourced, and the source path pointed one level too high, so the installer died at line 20 since the hosts-blocker extraction. Co-Authored-By: Claude Opus 5.5 --- .../evidence/reflector-dns-retry-2026-11-20.json | 11 +++++++++-- .../periodic_background/setup_periodic_system.sh | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/superpowers/evidence/reflector-dns-retry-2026-11-20.json b/docs/superpowers/evidence/reflector-dns-retry-2026-11-20.json index 78378a30..241cbf0a 100644 --- a/docs/superpowers/evidence/reflector-dns-retry-2026-11-20.json +++ b/docs/superpowers/evidence/reflector-dns-retry-2026-11-20.json @@ -2,10 +2,12 @@ "intent": "reflector.service no longer stays in systemctl --failed after a boot where DNS comes up after network-online.target.", "scope": [ "linux_configuration/periodic_background/setup_periodic_system.sh", - "drop-in source lives in kuhyx/system-maintenance systemd/reflector.service.d/retry-on-dns.conf" + "drop-in source lives in kuhyx/system-maintenance systemd/reflector.service.d/retry-on-dns.conf", + "linux_configuration/periodic_background/setup_periodic_system.sh sourced extracted_repos.sh after first use and from the wrong directory" ], "changes": [ - "setup_periodic_system.sh installs the reflector Restart=on-failure drop-in next to periodic-system-startup.service" + "setup_periodic_system.sh installs the reflector Restart=on-failure drop-in next to periodic-system-startup.service", + "source linux_configuration/lib/extracted_repos.sh before require_extracted_repo is called" ], "verification": [ { @@ -17,6 +19,11 @@ "command": "shellcheck linux_configuration/periodic_background/setup_periodic_system.sh", "result": "pass", "evidence": "no findings" + }, + { + "command": "sudo systemd-run --wait bash setup_periodic_system.sh", + "result": "pass", + "evidence": "red: line 20 require_extracted_repo: command not found; green: rc=0, reflector drop-in live, system-maintenance deploy.sh --check green" } ], "risks": [ diff --git a/linux_configuration/periodic_background/setup_periodic_system.sh b/linux_configuration/periodic_background/setup_periodic_system.sh index e30c9d45..bea2cb83 100755 --- a/linux_configuration/periodic_background/setup_periodic_system.sh +++ b/linux_configuration/periodic_background/setup_periodic_system.sh @@ -16,6 +16,8 @@ init_setup_script "Periodic System Setup - Pacman Wrapper & Hosts File" "$@" # Get the directory where this script is located CONFIG_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")" +# shellcheck source=../lib/extracted_repos.sh +source "$SCRIPT_DIR/../lib/extracted_repos.sh" # Define paths DW_REPO="$(require_extracted_repo digital-wellbeing "the periodic system setup")" || exit 1 PACMAN_WRAPPER_SCRIPT="$DW_REPO/pacman/pacman_wrapper.sh" @@ -24,8 +26,6 @@ MAKEPKG_WRAPPER_INSTALL="$DW_REPO/pacman/install_makepkg_wrapper.sh" # hosts-blocker was EXTRACTED out of this monorepo # (github.com/kuhyx/hosts-blocker), so this path deliberately lives # outside it. A missing checkout is fatal, never a silent skip. -# shellcheck source=../lib/extracted_repos.sh -source "$CONFIG_DIR/lib/extracted_repos.sh" HOSTS_BLOCKER_DIR_RESOLVED="$(require_extracted_repo hosts-blocker "the periodic system setup")" || exit 1 HOSTS_INSTALL_SCRIPT="$HOSTS_BLOCKER_DIR_RESOLVED/install.sh"