Files
wasm-simulator/list-linuxcnc-manifest-sources.sh
cnc b40914747d 满庭芳·源流归一
结论:LinuxCNC rs274ngc 源码移植边界继续收拢。已将 rs274ngc 头文件纳入 manifest 跟踪,core 编译组仍只包含可编译源文件;启用 CNC_SIM_ENABLE_LINUXCNC_RS274_BACKEND 时 API 默认使用 LinuxCNC rs274 后端;M428/M429/M430 与 5axis/TRT/TDR/RTCP 相关路径继续保持来自 LinuxCNC 源码或 remap 配置的薄桥接。

验证:./test-linuxcnc-source-syntax.sh;./test-linuxcnc-api-native.sh;./test-native.sh;./test-linuxcnc-source-link.sh。
2026-05-28 18:00:53 +08:00

74 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
manifest=${1:?manifest required}
filter_group=${2:?filter group required}
output_mode=${3:?output mode required}
allowed_groups=${4:?allowed groups required}
duplicate_groups=${5:?duplicate groups required}
missing_source_message=${6:?missing source message required}
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
contains_group() {
local groups=$1
local group=$2
[[ ",$groups," == *",$group,"* ]]
}
checks_duplicate_group() {
local groups=$1
local group=$2
[[ "$groups" == "all" ]] || contains_group "$groups" "$group"
}
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs.sh "$manifest"
if [[ "$filter_group" != "all" ]] && ! contains_group "$allowed_groups" "$filter_group"; then
echo "unknown manifest source filter: $filter_group" >&2
exit 1
fi
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
;;
esac
if ! contains_group "$allowed_groups" "$group"; then
echo "unknown manifest group: $group" >&2
exit 1
fi
full_path=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh \
--missing-message "$missing_source_message" \
"$path")
if checks_duplicate_group "$duplicate_groups" "$group"; 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' "$full_path"
else
printf '%s\n' "$path"
fi
fi
done < "$manifest"