From b32d7c99c64d6dcb7a68036a7abfa86b8b558627 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 10 Apr 2023 22:37:23 +0200 Subject: [PATCH] board/qemu: fix shellcheck in post-image script Commit 270759aff3cf (board/qemu: define start qemu script outside of post-image script) touches board/qemu/post-image.sh, so that exposed existing shellcheck issues. Fix those now. Signed-off-by: Yann E. MORIN Cc: James Knight --- board/qemu/post-image.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/board/qemu/post-image.sh b/board/qemu/post-image.sh index 57306dd546..ccd0fb78c9 100755 --- a/board/qemu/post-image.sh +++ b/board/qemu/post-image.sh @@ -1,8 +1,8 @@ #!/bin/bash -QEMU_BOARD_DIR="$(dirname $0)" -DEFCONFIG_NAME="$(basename $2)" -README_FILES="${QEMU_BOARD_DIR}/*/readme.txt" +QEMU_BOARD_DIR="$(dirname "$0")" +DEFCONFIG_NAME="$(basename "$2")" +README_FILE="${QEMU_BOARD_DIR}/*/readme.txt" START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh" if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then @@ -12,7 +12,7 @@ fi # Search for "# qemu_*_defconfig" tag in all readme.txt files. # Qemu command line on multilines using back slash are accepted. -QEMU_CMD_LINE=$(sed -r ':a; /\\$/N; s/\\\n//; s/\t/ /; ta; /# '${DEFCONFIG_NAME}'$/!d; s/#.*//' ${README_FILES}) +QEMU_CMD_LINE="$(sed -r ':a; /\\$/N; s/\\\n//; s/\t/ /; ta; /# '"${DEFCONFIG_NAME}"'$/!d; s/#.*//' \ "${README_FILE}")" if [ -z "${QEMU_CMD_LINE}" ]; then # No Qemu cmd line found, can't test.