build: make it pass shellcheck

Without that fix, running 'shellcheck -x build' produces the following
errors/warnings:
    In build line 25:
    [ "x${DEBUG+set}" = 'xset' ] && set -v
      ^-------------^ SC2268 (style): Avoid x-prefix in comparisons
                                      as it no longer serves a purpose.
    In build line 131:
    resources/packages/"${package}"/"${task}" $@
                                              ^-- SC2068 (error):
    Double quote array expansions to avoid re-splitting elements.

    In build line 138:
    "${pkg_dir}"/"${task}" $@
                           ^-- SC2068 (error):
    Double quote array expansions to avoid re-splitting elements.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-11-28 17:37:25 +01:00 committed by Adrien 'neox' Bourmault
parent de1d84340d
commit e0159d22f4
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
2 changed files with 4 additions and 1 deletions

4
build
View File

@ -22,7 +22,7 @@
#
./.gitcheck
[ "x${DEBUG+set}" = 'xset' ] && set -v
[ "${DEBUG+set}" = 'set' ] && set -v
set -u -e
projectname="$(cat projectname)"
@ -127,6 +127,7 @@ if [ $# -gt 1 ]; then
;;
all)
for package in $(list_packages "${task}"); do
# shellcheck disable=SC2068
resources/packages/"${package}"/"${task}" $@
done
;;
@ -134,6 +135,7 @@ if [ $# -gt 1 ]; then
if [ -d resources/packages/"${package}" ] ; then
pkg_dir=resources/packages/"${package}"
if [ -f "${pkg_dir}"/"${task}" ]; then
# shellcheck disable=SC2068
"${pkg_dir}"/"${task}" $@
else
help

View File

@ -41,6 +41,7 @@ printf "+---------------------+\n"
printf "| Running lint tests: |\n"
printf "+---------------------+\n"
run_shellcheck \
build \
resources/packages/descriptors/distclean \
resources/packages/flashrom/distclean \
resources/packages/grub/distclean \