高效率推进 LinuxCNC 源码对齐流程
说明:集中 LinuxCNC 源码清单与 wasm/native probe 的路径解析,补强 manifest、shim、source-link 检查,并保持 LinuxCNC 源码后端对齐验证流程可复用。 验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-all-native.sh;wasm source/probe 相关脚本。
This commit is contained in:
72
list-linuxcnc-source-manifest-sources.sh
Executable file
72
list-linuxcnc-source-manifest-sources.sh
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
manifest=${1:-linuxcnc-rs274-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|binding|tooldata|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|binding|tooldata)
|
||||
;;
|
||||
*)
|
||||
echo "unknown manifest group: $group" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ ! -f "$linuxcnc_root/$path" ]]; then
|
||||
echo "missing manifest file: $path" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$group" == "core" ]]; then
|
||||
if printf '%s\n' "${seen_sources[@]}" | grep -Fx -- "$path" >/dev/null; then
|
||||
echo "duplicate manifest source: $path" >&2
|
||||
exit 1
|
||||
fi
|
||||
seen_sources+=("$path")
|
||||
fi
|
||||
|
||||
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"
|
||||
Reference in New Issue
Block a user