Files
cnc_wams/wasm-port/tools/verify_upstream_baseline.sh
wangdequan facffaab89 按推荐建议,继续执行
结论:记录 LinuxCNC 上游 commit 与本地构建/fixture 基线,新增 upstream baseline 验证并接入 native 验证,确保 vendored 源码同步绑定到明确的 LinuxCNC 源程序版本。
2026-06-07 18:36:09 +08:00

35 lines
942 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
UPSTREAM_DIR="$ROOT_DIR/../linuxcnc"
BASELINE_FILE="$ROOT_DIR/tools/upstream-baseline.txt"
if [[ ! -d "$UPSTREAM_DIR/.git" ]]; then
echo "missing upstream git repository: $UPSTREAM_DIR" >&2
exit 1
fi
if [[ ! -f "$BASELINE_FILE" ]]; then
echo "missing upstream baseline file: $BASELINE_FILE" >&2
exit 1
fi
expected="$(sed -n '1p' "$BASELINE_FILE" | tr -d '[:space:]')"
actual="$(git -C "$UPSTREAM_DIR" rev-parse HEAD)"
if [[ -z "$expected" ]]; then
echo "empty upstream baseline file: $BASELINE_FILE" >&2
exit 1
fi
if [[ "$actual" != "$expected" ]]; then
echo "upstream baseline mismatch:" >&2
echo " expected: $expected" >&2
echo " actual: $actual" >&2
echo "Update tools/upstream-baseline.txt and docs/scope-and-baseline.md only after an intentional upstream sync." >&2
exit 1
fi
echo "upstream baseline validation complete"