说明:集中 LinuxCNC 源码清单与 wasm/native probe 的路径解析,补强 manifest、shim、source-link 检查,并保持 LinuxCNC 源码后端对齐验证流程可复用。 验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-all-native.sh;wasm source/probe 相关脚本。
71 lines
1.5 KiB
Bash
Executable File
71 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
|
|
filter_group=${2:-core}
|
|
output_mode=${3:-relative}
|
|
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
|
|
|
if [[ ! -f "$manifest" ]]; then
|
|
echo "missing manifest: $manifest" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -d "$linuxcnc_root" ]]; then
|
|
echo "missing LinuxCNC root: $linuxcnc_root" >&2
|
|
exit 1
|
|
fi
|
|
|
|
case "$filter_group" in
|
|
core|blocked|all)
|
|
;;
|
|
*)
|
|
echo "unknown manifest source filter: $filter_group" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
case "$output_mode" in
|
|
relative|full)
|
|
;;
|
|
*)
|
|
echo "unknown manifest source output mode: $output_mode" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
seen_sources=()
|
|
while IFS=: read -r group path note; do
|
|
case "$group" in
|
|
""|\#*)
|
|
continue
|
|
;;
|
|
core|blocked)
|
|
;;
|
|
*)
|
|
echo "unknown manifest group: $group" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
if [[ ! -f "$linuxcnc_root/$path" ]]; then
|
|
echo "missing manifest source: $path" >&2
|
|
exit 1
|
|
fi
|
|
if printf '%s\n' "${seen_sources[@]}" | grep -Fx -- "$path" >/dev/null; then
|
|
echo "duplicate manifest source: $path" >&2
|
|
exit 1
|
|
fi
|
|
seen_sources+=("$path")
|
|
|
|
if [[ "$filter_group" == "all" || "$filter_group" == "$group" ]]; then
|
|
if [[ "$output_mode" == "full" ]]; then
|
|
printf '%s\n' "$linuxcnc_root/$path"
|
|
else
|
|
printf '%s\n' "$path"
|
|
fi
|
|
fi
|
|
done < "$manifest"
|