testsAndMisc/linux_configuration/scripts/single_use/fixes
Krzysztof kuhy Rudnicki 76e73830f6 shell: split clean_audio, enforce_vbox_hosts and migrate_hosts_guard
clean_audio.sh          419 -> 230 + 204
  enforce_vbox_hosts.sh   443 -> 220 + 236
  migrate_hosts_guard.sh  444 -> 167 + 162 + 141

migrate_hosts_guard needed two libraries: with all ten work functions moved
the single lib was 295 lines, so migrate and rollback were separated.

The extractor's brace matcher required index > start and so silently skipped
one-line `warn() { ...; }` definitions. Fixed, and regression-checked against
the committed fresh-install/main.sh split byte-for-byte.

The harness earned its keep on a fourth file: adding `export` to libre_translate
to satisfy SC2034 changed two function bodies, and verify_shell_split.sh caught
what lint had accepted. Those exports were reverted, and libre_translate.sh is
parked - what remains after its clean seams both assigns and reads the same
globals, so getting it under the cap needs parse_args restructured rather than
relocated, which is a refactor rather than a verbatim move.

That cost is now written down: a lib must contain the readers of every global
it assigns. The precedent at install_pacman_wrapper.sh:29 is about
definitions-only libs, not about assignments as such, and the pre-commit hook
runs shellcheck with no -x, so a source= directive will not make it follow the
link. This is the shell analogue of the monkeypatch-target trap.

Verified: all 8, 13 and 19 functions verbatim; all four libraries source with
no side effects; shellcheck passes standalone on every file with no
suppression; bash -n passes on all seven. None of the three was executed -
they drive ffmpeg over real media, mutate VirtualBox guest disks, and rewrite
systemd units.

Over-cap files 29 -> 26.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 14:27:57 +02:00
..
lib shell: split clean_audio, enforce_vbox_hosts and migrate_hosts_guard 2026-08-17 14:27:57 +02:00
diagnose_arch_performance.sh Split five more linux_configuration single_use scripts 2026-08-16 18:51:28 +02:00
diagnose_pacman_hook_stall.sh Diagnose the pacman first-hook stall; fix the drift that hid a stale wrapper 2026-08-03 15:15:34 +02:00
fix_anki.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_arch_performance.sh Split seven more linux_configuration scripts 2026-08-16 18:56:05 +02:00
fix_bluetooth.sh Split fix_bluetooth.sh 720 -> 186; defer steam_compatibility.sh 2026-08-16 19:17:05 +02:00
fix_controller.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_flutter_git_env.sh Fix: stop the Flutter SDK reading your own repo as itself inside git hooks 2026-07-26 15:39:33 +02:00
fix_stepmania.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_systemctl.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_thorium.sh Split three more linux_configuration feature and fix scripts 2026-08-16 18:48:01 +02:00
fix_ubuntu_performance.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
fix_virtualbox.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_waifu2x.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
fix_yay_aur_database.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
migrate_hosts_guard_to_guard_lib.sh shell: split clean_audio, enforce_vbox_hosts and migrate_hosts_guard 2026-08-17 14:27:57 +02:00
nvidia_troubleshoot.sh fixes/utils: split nvidia_troubleshoot 336 -> 169+181, passwordless 374 -> 195+193 2026-08-17 14:18:06 +02:00
optimize_arch_desktop.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00