testsAndMisc/linux_configuration/scripts/single_use/utils/lib
Krzysztof kuhy Rudnicki 936e0ec70d Fix two runtime defects the analyze_repo.sh split introduced
41cc045 passed bash -n, shellcheck, a function-set diff, a line-set diff
and a stubbed source run -- and still shipped a script that aborted after
language detection. Both bugs needed a real execution to see.

1. set -e. The eight `((LANG_FILES[x] > 0)) && HAS_Y=true` lines were
   top-level statements, where a false `&&` merely left $? non-zero. As
   the tail of detect_languages they became its return value, and the
   last one (java, false for most repos) killed the script. Now `|| true`.

2. Self-referencing nameref. `local -n LANG_CODE_FILES="$1"` pointing at
   a global of the same name makes bash 5.3 warn "circular name
   reference" on every access -- into this script's own output. The
   locals are now _code_files.

The rename then hid the array from shellcheck (SC2034), since it was only
named as a bare word. Fixed by passing it through CODE_FILES_MAP so the
reference is real, not by suppressing.

Verified against 133fccf end to end on a fixture repo: same file set,
every text artifact byte-identical, exit 0 both sides, zero warnings.
Only cscope.out.in differs, in binary padding -- same input list, same
90112 bytes.

The lesson for the recipe doc: a stubbed run sources the libs and never
calls them, so it cannot reach a bug in a seam that passes state.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-16 22:02:17 +02:00
..
analyze_repo_report.sh Fix two runtime defects the analyze_repo.sh split introduced 2026-08-16 22:02:17 +02:00
analyze_repo_scan.sh Split analyze_repo.sh into an entry script and five libs 2026-08-16 21:47:03 +02:00
analyze_repo_separate.sh Fix two runtime defects the analyze_repo.sh split introduced 2026-08-16 22:02:17 +02:00
analyze_repo_symbols.sh Split analyze_repo.sh into an entry script and five libs 2026-08-16 21:47:03 +02:00
analyze_repo_tools.sh Split analyze_repo.sh into an entry script and five libs 2026-08-16 21:47:03 +02:00
android_commands.sh Split update_android_hosts.sh; extract its blocklist as data 2026-08-16 21:23:39 +02:00
android_device.sh Split update_android_hosts.sh; extract its blocklist as data 2026-08-16 21:23:39 +02:00
android_module.sh Split update_android_hosts.sh; extract its blocklist as data 2026-08-16 21:23:39 +02:00
bl9000_backup.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
bl9000_deps.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
bl9000_device.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
bl9000_magisk.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
bl9000_mtkclient.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
bl9000_usage.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
docs_all.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
docs_cpp.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
docs_js.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
docs_python_keywords.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
docs_python.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
docs_rust.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
download_classify.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
download_media.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
download_sizes.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
exercism_config.sh Split seven more linux_configuration scripts 2026-08-16 18:56:05 +02:00
idle_inhibit.sh Split three near-miss linux_configuration scripts 2026-08-16 18:38:43 +02:00
offline_cpp.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00
offline_index.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00
offline_js.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00
offline_python.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00
offline_rust.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00
offline_status.sh Split offline docs and arch optimiser; defer libre_translate 2026-08-16 20:09:54 +02:00
repo_study_steps.sh Split five more linux_configuration single_use scripts 2026-08-16 18:51:28 +02:00
sd_card_ops.sh Split seven more linux_configuration scripts 2026-08-16 18:56:05 +02:00