Fix periodic setup: source repo lib first
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / lib-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run

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 <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-20 08:12:40 +01:00
parent fc865df4be
commit 7d5c19bf88
2 changed files with 11 additions and 4 deletions

View File

@ -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": [

View File

@ -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"