From 8fc32976a5b296de17c4eae6f3f87ceeee4f4d53 Mon Sep 17 00:00:00 2001 From: BFE Engineering Date: Thu, 29 Oct 2026 09:10:37 -0600 Subject: [PATCH] qemu: clear the two shellcheck notes in the prebuilt BusyBox check (flare-edge#2210) CI's shellcheck 0.9.0 failed qemu-tools on #38: SC2015 on the `[ -f ] && [ = ] || { ... }` refusal in qemu_get_busybox (now an if), and SC2012 on the `ls | head` that picks a patch to edit in busybox-panel-test.sh (now find | sort | head). No behaviour change. Refs flare-edge#2210 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG --- qemu/lib.sh | 4 ++-- qemu/tests/busybox-panel-test.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/qemu/lib.sh b/qemu/lib.sh index 4ca3798..cff57f2 100644 --- a/qemu/lib.sh +++ b/qemu/lib.sh @@ -100,10 +100,10 @@ qemu_get_busybox() { local want got want="$(qemu_busybox_panel_inputs)" got="$(cat "$BUSYBOX.inputs" 2>/dev/null || true)" - [ -f "$BUSYBOX" ] && [ "$got" = "$want" ] || { + if [ ! -f "$BUSYBOX" ] || [ "$got" != "$want" ]; then echo "FATAL: BUSYBOX=$BUSYBOX is not a panel BusyBox built from this tree's qemu/busybox/ ($BUSYBOX.inputs '${got:-missing}', want '$want'): run qemu/build-busybox.sh" >&2 exit 1 - } + fi BB="$BUSYBOX" qemu_log "panel busybox: prebuilt $BB (inputs $want)" return diff --git a/qemu/tests/busybox-panel-test.sh b/qemu/tests/busybox-panel-test.sh index fcc737e..d52c1fd 100644 --- a/qemu/tests/busybox-panel-test.sh +++ b/qemu/tests/busybox-panel-test.sh @@ -149,7 +149,8 @@ mkdir -p "$SCRATCH/qcopy" cp -a "$QEMU_DIR/busybox" "$SCRATCH/qcopy/" printf '# CONFIG_TIMEOUT is not set\n' >> "$SCRATCH/qcopy/busybox/panel.config" other="$(QEMU_DIR="$SCRATCH/qcopy" qemu_busybox_panel_inputs)" -printf 'x\n' >> "$SCRATCH/qcopy/busybox/patches/$(ls "$QEMU_DIR/busybox/patches" | head -n 1)" +first_patch="$(find "$SCRATCH/qcopy/busybox/patches" -maxdepth 1 -type f -name '*.patch' | sort | head -n 1)" +printf 'x\n' >> "$first_patch" other2="$(QEMU_DIR="$SCRATCH/qcopy" qemu_busybox_panel_inputs)" if [ "$other" != "$inputs" ] && [ "$other2" != "$other" ]; then pass "a panel.config or patch edit changes qemu_busybox_panel_inputs"