[Buildroot] [git commit] board/qemu: fix shellcheck in post-image script

Arnout Vandecappelle arnout at mind.be
Tue Apr 11 07:01:15 UTC 2023



On 10/04/2023 23:16, Yann E. MORIN wrote:
> commit: https://git.buildroot.net/buildroot/commit/?id=b32d7c99c64d6dcb7a68036a7abfa86b8b558627
> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
> 
> 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.

  You forgot to update .shellcheckignore...

  Fixed that now.

  Regards,
  Arnout

> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
> Cc: James Knight <james.d.knight at live.com>
> ---
>   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.
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot



More information about the buildroot mailing list