From 7c7e549ffdcd4532534b776e289301b3e4fc8dde Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 13 Jul 2026 10:53:40 +0200 Subject: test-build: wire main, image-presence check, target lookup --- .extras/test-build | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to '.extras') diff --git a/.extras/test-build b/.extras/test-build index fe864bb..ecd763f 100755 --- a/.extras/test-build +++ b/.extras/test-build @@ -707,12 +707,49 @@ print_summary() { } >> "$summary" } + +# Verify the selected image exists locally. It is built by a separate job; this +# script only consumes it. (Later: a local-registry docker pull slots in here.) +require_image() { + if ! docker image inspect "$ACTIVE_IMAGE" >/dev/null 2>&1; then + cat >&2 </dev/null 2>&1 || { echo "docker not found in PATH." >&2; exit 1; } + require_image + fi + resolve_cache_root + + RUN_DIR="$LOG_ROOT/$(date +%Y-%m-%d_%H-%M-%S)" + mkdir -p "$RUN_DIR" + : > "$RUN_DIR/build-order.txt" + + # Single-package mode: resolve the name in the active tree. + local tdir + if ! tdir="$(find_slackbuild_dir "$TARGET_ARG")"; then + echo "Program not found in the SBo tree ($ACTIVE_TREE): $TARGET_ARG" >&2 + exit 1 + fi + + run_target "$tdir" + print_summary } main "$@" -- cgit v1.2.3