diff options
| -rwxr-xr-x | .extras/test-build | 37 |
1 files changed, 37 insertions, 0 deletions
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 <<EOF +Image not found locally: $ACTIVE_IMAGE +It is produced by the separate image-builder job (full Slackware $VERSION_ID + +sbo-maintainer-tools + sbopkg), stored on the NAS / local registry. Load or +pull it, then rerun. This script does not build images. +EOF + exit 1 + fi +} + main() { parse_args "$@" init_color require_config SBO_TREE_ROOTS=("$ACTIVE_TREE") load_overrides + + # image + cache namespace (skip the image check on a pure dry-run so the order + # can be inspected without the image present). + if [[ $DRY_RUN -eq 0 ]]; then + command -v docker >/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 "$@" |
