download: make it pass shellcheck

Without that fix, running 'shellcheck -x build' produces the following
errors/warnings:
    In download line 26:
    [ "x${DEBUG+set}" = 'xset' ] && set -v
      ^-------------^ SC2268 (style):
    Avoid x-prefix in comparisons as it no longer serves a purpose.

    In download line 37:
    [ "x${NODELETE+set}" = 'xset' ] && deleteblobs="false"
      ^----------------^ SC2268 (style):
    Avoid x-prefix in comparisons as it no longer serves a purpose.

    In download line 102:
    NODELETE= "${script}"
             ^-- SC1007 (warning):
    Remove space after = if trying to assign a value (for empty string,
    use var='' ... ).

    In download line 117:
    NODELETE= resources/packages/"${package}"/download
             ^-- SC1007 (warning):
    Remove space after = if trying to assign a value (for empty string,
    use var='' ... ).

    In download line 123:
    NODELETE= resources/packages/"${package}"/download $@
             ^-- SC1007 (warning):
    Remove space after = if trying to assign a value (for empty string,
    use var='' ... ).
                                                       ^-- SC2068 (error):
    Double quote array expansions to avoid re-splitting elements.

    In download line 125:
    resources/packages/"${package}"/download $@
                                             ^-- SC2068 (error):
    Double quote array expansions to avoid re-splitting elements.

    In download line 131:
    ./.gitcheck clean
    ^---------------^ SC2317 (info):
    Command appears to be unreachable. Check usage (or ignore if invoked
    indirectly).

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 2a5e494ac9
commit 68cb3ac110
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
2 changed files with 13 additions and 8 deletions

View File

@ -21,9 +21,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# shellcheck source=.gitcheck
./.gitcheck
[ "x${DEBUG+set}" = 'xset' ] && set -v
[ "${DEBUG+set}" = 'set' ] && set -v
set -u -e
./resources/scripts/misc/versioncheck
@ -32,9 +33,9 @@ set -u -e
# set this when you want to modify each coreboot tree
# for example, you want to test custom patches
# NODELETE= ./download coreboot
# NODELETE='' ./download coreboot
deleteblobs="true"
[ "x${NODELETE+set}" = 'xset' ] && deleteblobs="false"
[ "${NODELETE+set}" = 'set' ] && deleteblobs="false"
rm -f "build_error"
@ -99,7 +100,7 @@ shift 1
if [ "${package}" = "all" ]; then
for script in resources/packages/*/download; do
if [ "${deleteblobs}" = "false" ]; then
NODELETE= "${script}"
NODELETE='' "${script}"
else
"${script}"
fi
@ -114,18 +115,21 @@ fi
if [ $# -lt 1 ]; then
if [ "${deleteblobs}" = "false" ]; then
NODELETE= resources/packages/"${package}"/download
NODELETE='' resources/packages/"${package}"/download
else
resources/packages/"${package}"/download
fi
else
if [ "${deleteblobs}" = "false" ]; then
NODELETE= resources/packages/"${package}"/download $@
# shellcheck disable=SC2068
NODELETE='' resources/packages/"${package}"/download $@
else
# shellcheck disable=SC2068
resources/packages/"${package}"/download $@
fi
fi
exit 0
# shellcheck disable=SC2317
./.gitcheck clean
exit 0

View File

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