结论:新增 standalone CNC 语义守卫,禁止在 wrapper/tools/tests 中重新定义 Interp::convert_g(),确保 G-code 转换继续走 vendored LinuxCNC interp_convert.cc。
27 lines
753 B
Bash
Executable File
27 lines
753 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
TMP_FILE="$(mktemp)"
|
|
trap 'rm -f "$TMP_FILE"' EXIT
|
|
|
|
find \
|
|
"$ROOT_DIR/runtime" \
|
|
"$ROOT_DIR/tests" \
|
|
"$ROOT_DIR/tools" \
|
|
-type f \
|
|
\( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hh' -o -name '*.hpp' -o -name '*.js' -o -name '*.ts' \) \
|
|
! -path "$ROOT_DIR/vendor/*" \
|
|
! -path "$ROOT_DIR/runtime/ui/ini-panel/linuxcnc_ini.js" \
|
|
-print0 |
|
|
xargs -0 grep -nE '^[[:space:]]*int[[:space:]]+Interp::convert_g[[:space:]]*\(' > "$TMP_FILE" || true
|
|
|
|
if [[ -s "$TMP_FILE" ]]; then
|
|
echo "standalone Interp::convert_g definitions are not allowed:" >&2
|
|
cat "$TMP_FILE" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "standalone CNC semantics guard complete"
|