testsAndMisc/linux_configuration/scripts/periodic_background/digital_wellbeing/pacman
Krzysztof kuhy Rudnicki 4eedc17b17 Split install_pacman_wrapper.sh into an entry plus four libs
The 316-line installer was 66 over the 250-line cap. The managed-copy helpers,
the /usr/local/bin install step, the integrity + drift manifest, and the
immutability/LeechBlock/VirtualBox payloads move into a sibling lib/, leaving a
128-line entry.

What stays in the entry is chosen by what the harness can execute, not by
taste. `--bind-abs /usr/bin` removes the directory bwrap needs to exec
anything, so the trace stops at `ln -sf ... /usr/bin/pacman` with exit 1 on
EPERM. That line onwards, plus the `if [ ! -L /usr/bin/pacman ]` backup branch
whose guard is false on this machine, therefore never run under trace — moving
them would have shipped code no diff could check. They stay put.

Everything else is proven: the before/after traces are identical, including all
16 generated-file hashes. pacman_wrapper at 548fc2b53ee4cea6 is the one that
matters most — it is post-`sed -i`, so it catches a reorder of the rewrite
relative to the copy.

The path definitions stay in the entry too, for a linter reason rather than a
runtime one: a definitions-only lib assigns without referencing, which is
SC2034 on 36 variables, and suppressions are not allowed. Libs that only
reference globals are fine. `export` would have silenced it while leaking 40
variables into every child process, which the trace cannot see.

Eight assertions across two test libs grep the installer's source text; five
needed widening to search entry+lib/. TEST 9's `chattr +i` grep caught the move
as a genuine failure first, which is what prompted enumerating the rest. No
assertion was weakened.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 07:42:31 +02:00
..
lib Split install_pacman_wrapper.sh into an entry plus four libs 2026-08-17 07:42:31 +02:00
llm-notes Bring every markdown file under the cap 2026-08-16 19:25:59 +02:00
96-restore-pkg-wrappers.hook fix(pacman): wrap makepkg so an orphaned db.lck can't hang makepkg -i 2026-07-17 07:46:31 +02:00
install_makepkg_wrapper.sh Diagnose the pacman first-hook stall; fix the drift that hid a stale wrapper 2026-08-03 15:15:34 +02:00
install_pacman_wrapper.sh Split install_pacman_wrapper.sh into an entry plus four libs 2026-08-17 07:42:31 +02:00
makepkg_capped.sh Diagnose the pacman first-hook stall; fix the drift that hid a stale wrapper 2026-08-03 15:15:34 +02:00
makepkg_wrapper.sh fix(pacman): wrap makepkg so an orphaned db.lck can't hang makepkg -i 2026-07-17 07:46:31 +02:00
mkpkg.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
pacman_blocked_keywords.txt refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
pacman_greylist.txt refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
pacman_lock_lib.sh fix(pacman): wrap makepkg so an orphaned db.lck can't hang makepkg -i 2026-07-17 07:46:31 +02:00
pacman_whitelist.txt Fix pacman whitelist matching for yay's -U package-file installs 2026-08-12 22:43:30 +02:00
pacman_wrapper.sh Fix pacman whitelist matching for yay's -U package-file installs 2026-08-12 22:43:30 +02:00
README_FOR_LLM.md Apply prettier to two split prose files 2026-08-16 19:31:54 +02:00
rewrap_pkg_managers.sh fix(pacman): wrap makepkg so an orphaned db.lck can't hang makepkg -i 2026-07-17 07:46:31 +02:00
words.txt refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00