Fix kiwix-tools rebuilds, failed-build handling, and config expansion

- compile.conf: kiwix-tools never installs kiwix-lib, so it was rebuilt
  on every update; detect it by kiwix-serve instead
- install-compiled.sh: stop at the first failing build step, report the
  app as failed, and don't record its version so the next update retries
- install-binaries.sh, install-compiled.sh: expand only $HOME,
  $HAMPACK_DIR and $USER in config values instead of `eval echo`, which
  dropped semicolons (e.g. categories=HamRadio;) and mangled quotes and
  spacing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Young
2026-11-08 09:24:58 -07:00
co-authored by Claude Opus 5.5
parent 52f043d0b5
commit ebda32d567
3 changed files with 41 additions and 13 deletions
+11 -1
View File
@@ -9,6 +9,16 @@ TMP_DIR="/tmp/hampack-build"
VERSION_FILE="$HOME/.local/state/HamPack/.installed_versions"
FAILED=()
# Expand $HOME, $HAMPACK_DIR and $USER in a config value. Unlike `eval echo`,
# this leaves everything else (semicolons, quotes, spacing) untouched.
expand_vars() {
local v="$1"
v="${v//\$HAMPACK_DIR/"$HAMPACK_DIR"}"
v="${v//\$HOME/"$HOME"}"
v="${v//\$USER/"$USER"}"
printf '%s\n' "$v"
}
# Get the installed version of an app
get_installed_version() {
local app="$1"
@@ -197,7 +207,7 @@ process_conf() {
local key="${line%%=*}"
local value="${line#*=}"
value=$(eval echo "$value")
value=$(expand_vars "$value")
case "$key" in
url) url="$value" ;;