#!/usr/bin/env bash # Thin entrypoint: detached-derived validation for board-viewer six assets. # Does not require BRD; never claims BRD regeneration (not_packaged_by_policy). # Prefer PRODU2_VERIFY_VENV Python so jsonschema and other verify deps resolve. set -euo pipefail unset LD_LIBRARY_PATH LD_PRELOAD QT_PLUGIN_PATH || true ROOT="$(cd "$(dirname "$0")/.." && pwd)" VENV="${PRODU2_VERIFY_VENV:-${XDG_CACHE_HOME:-$HOME/.cache}/prod2u/venvs/verify}" PY="${VENV}/bin/python" if [[ ! -x "$PY" ]]; then PY=python3 fi # Keep a clean system PATH for subprocess tools, but never put it ahead of the # selected interpreter (venv must win for site-packages such as jsonschema). export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${PATH:+:$PATH}" LOG_DIR="${BOARDVIEW_LOG_DIR:-}" ARGS=() if [[ -n "$LOG_DIR" ]]; then mkdir -p "$LOG_DIR" ARGS+=(--json-out "$LOG_DIR/detached-derived-report.json") fi cd "$ROOT/tools/board-viewer" exec "$PY" -B validate_detached_derived.py "${ARGS[@]}" "$@"