fix(updater): load the ladder before probing for newer tags

updaterNewerVersionByProbe guarded on updaterTagExists being defined
and gave up when it was not. That function lives in the ladder, and a
cross-file function is not reliably loaded in the generator's context —
updaterAppPolicy a few lines below already carries an explicit source
fallback for exactly this. Without one the probe silently did nothing,
which is the failure mode it was added to remove.

Source the ladder when the function is absent, matching the existing
idiom. Verified by calling the probe with updaterTagExists undefined:
it now loads the ladder and returns v1.159.0 for matrixdotorg/synapse
instead of an empty string.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
librelad 2026-08-19 02:15:10 +01:00
parent abcfdc134a
commit f8d7dd139d
2 changed files with 13 additions and 1 deletions

View File

@ -684,6 +684,7 @@ declare -gA LP_FN_MAP=(
[_lpvCheckCompose]="validation/validate_config.sh"
[_lpvCheckConfigFile]="validation/validate_config.sh"
[_lpvCheckDeployedSecrets]="validation/validate_config.sh"
[_lpvCheckDeployedValues]="validation/validate_config.sh"
[_lpvCheckPlaceholders]="validation/validate_config.sh"
[lpVerifyInstall]="source/verify.sh"
[lpVerifyMinisig]="source/fetch.sh"
@ -1831,6 +1832,7 @@ declare -gA LP_FN_ROOT=(
[_lpvCheckCompose]="scripts"
[_lpvCheckConfigFile]="scripts"
[_lpvCheckDeployedSecrets]="scripts"
[_lpvCheckDeployedValues]="scripts"
[_lpvCheckPlaceholders]="scripts"
[lpVerifyInstall]="scripts"
[lpVerifyMinisig]="scripts"
@ -3014,6 +3016,7 @@ _lpvCheckAuthAdapter() { unset -f _lpvCheckAuthAdapter; __lpAutoload "${install_
_lpvCheckCompose() { unset -f _lpvCheckCompose; __lpAutoload "${install_scripts_dir}validation/validate_config.sh"; _lpvCheckCompose "$@"; }
_lpvCheckConfigFile() { unset -f _lpvCheckConfigFile; __lpAutoload "${install_scripts_dir}validation/validate_config.sh"; _lpvCheckConfigFile "$@"; }
_lpvCheckDeployedSecrets() { unset -f _lpvCheckDeployedSecrets; __lpAutoload "${install_scripts_dir}validation/validate_config.sh"; _lpvCheckDeployedSecrets "$@"; }
_lpvCheckDeployedValues() { unset -f _lpvCheckDeployedValues; __lpAutoload "${install_scripts_dir}validation/validate_config.sh"; _lpvCheckDeployedValues "$@"; }
_lpvCheckPlaceholders() { unset -f _lpvCheckPlaceholders; __lpAutoload "${install_scripts_dir}validation/validate_config.sh"; _lpvCheckPlaceholders "$@"; }
lpVerifyInstall() { unset -f lpVerifyInstall; __lpAutoload "${install_scripts_dir}source/verify.sh"; lpVerifyInstall "$@"; }
lpVerifyMinisig() { unset -f lpVerifyMinisig; __lpAutoload "${install_scripts_dir}source/fetch.sh"; lpVerifyMinisig "$@"; }

View File

@ -241,7 +241,16 @@ updaterTagBumpAt() {
# turn one app's scan into a crawl.
updaterNewerVersionByProbe() {
local cur="$1" repo="$2"
declare -F updaterTagExists >/dev/null 2>&1 || return 0 # ladder unavailable
# updaterTagExists lives in the ladder, and a cross-file function is not
# reliably already loaded here — same situation updaterAppPolicy handles
# below, so use the same remedy rather than assuming. Without the explicit
# source a missing function would make this whole fallback silently do
# nothing, which is precisely the failure mode it exists to remove.
if ! declare -F updaterTagExists >/dev/null 2>&1; then
[ -f "$install_scripts_dir/cli/commands/updater/cli_updater_ladder.sh" ] \
&& source "$install_scripts_dir/cli/commands/updater/cli_updater_ladder.sh" 2>/dev/null
declare -F updaterTagExists >/dev/null 2>&1 || return 0
fi
local shape; shape="$(updaterTagShape "$cur")"
local ncomp; ncomp="$(printf '%s' "$cur" | grep -oE '[0-9]+' | wc -l | tr -d ' ')"
[ "${ncomp:-0}" -gt 0 ] 2>/dev/null || return 0