validate-board-viewer-detached.sh 1012 B

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