From dcf246c0a05d718ad4e3926178df758a87d8131d Mon Sep 17 00:00:00 2001 From: cnc Date: Wed, 3 Jun 2026 17:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E8=80=83=E6=89=80=E6=9C=89=E5=88=86?= =?UTF-8?q?=E7=BB=84=EF=BC=8C=E5=AE=8C=E6=88=90=E5=B0=BD=E9=87=8F=E5=A4=9A?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=EF=BC=9A=E6=94=B6=E7=B4=A7=20manife?= =?UTF-8?q?st=20=E5=9D=8F=E8=A1=8C=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:通用 LinuxCNC manifest lister 现在与输入校验一致拒绝缺少 note 或字段数量异常的坏行,并在 all-native guardrail 中覆盖通用 lister 与 native/source-link 调用链;未扩展 smoke 功能。 --- list-linuxcnc-manifest-sources.sh | 11 +++++++++-- test-all-native.sh | 32 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/list-linuxcnc-manifest-sources.sh b/list-linuxcnc-manifest-sources.sh index 2771058..b45a624 100755 --- a/list-linuxcnc-manifest-sources.sh +++ b/list-linuxcnc-manifest-sources.sh @@ -44,13 +44,20 @@ case "$output_mode" in esac seen_sources=() -while IFS=: read -r group path note; do - case "$group" in +manifest_line_number=0 +while IFS= read -r manifest_line || [[ -n "$manifest_line" ]]; do + manifest_line_number=$((manifest_line_number + 1)) + case "$manifest_line" in ""|\#*) continue ;; esac + IFS=: read -r group path note extra <<<"$manifest_line" + if [[ -z "$group" || -z "$path" || -z "$note" || -n "${extra:-}" ]]; then + echo "bad manifest line $manifest_line_number: $manifest_line" >&2 + exit 1 + fi if ! contains_group "$allowed_groups" "$group"; then echo "unknown manifest group: $group" >&2 exit 1 diff --git a/test-all-native.sh b/test-all-native.sh index 3d544bb..d1963d1 100755 --- a/test-all-native.sh +++ b/test-all-native.sh @@ -1013,6 +1013,38 @@ for script in \ fi done +printf 'core:src/emc/rs274ngc/interp_arc.cc\n' >"$bad_line_manifest" +if ./list-linuxcnc-manifest-sources.sh \ + "$bad_line_manifest" \ + core \ + relative \ + core \ + core \ + "missing manifest source" >"$bad_line_log" 2>&1; then + echo "common manifest source lister accepted bad manifest line" >&2 + exit 1 +fi +if ! grep -F "bad manifest line 1: core:src/emc/rs274ngc/interp_arc.cc" "$bad_line_log" >/dev/null; then + echo "common manifest source lister did not report bad manifest line clearly" >&2 + sed -n '1,20p' "$bad_line_log" >&2 + exit 1 +fi +for script in \ + list-linuxcnc-source-manifest-sources.sh \ + test-linuxcnc-source-syntax.sh \ + test-linuxcnc-source-objects.sh \ + test-linuxcnc-source-link.sh; do + if "./$script" "$bad_line_manifest" >"$bad_line_log" 2>&1; then + echo "$script accepted bad manifest line" >&2 + exit 1 + fi + if ! grep -F "bad manifest line 1: core:src/emc/rs274ngc/interp_arc.cc" "$bad_line_log" >/dev/null; then + echo "$script did not report bad manifest line clearly" >&2 + sed -n '1,20p' "$bad_line_log" >&2 + exit 1 + fi +done + ./list-linuxcnc-source-manifest-sources.sh "$manifest" core >/dev/null native_manifest_core=$(./list-linuxcnc-source-manifest-sources.sh "$manifest" core) grep -Fx "src/emc/rs274ngc/interp_arc.cc" <<<"$native_manifest_core" >/dev/null