modify: make it pass shellcheck

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

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

    In modify line 113:
    "${pkg_dir}"/modify/"${option}" $@
                                    ^-- 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 e0159d22f4
commit 2a5e494ac9
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
2 changed files with 4 additions and 1 deletions

4
modify
View File

@ -20,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "${DEBUG+set}" = 'set' ] && set -v
set -u -e set -u -e
projectname="$(cat projectname)" projectname="$(cat projectname)"
@ -103,6 +103,7 @@ if [ $# -gt 1 ]; then
;; ;;
all) all)
for option in $(listoptions "${package}"); do for option in $(listoptions "${package}"); do
# shellcheck disable=SC2068
resources/packages/"${package}"/modify/"${option}" $@ resources/packages/"${package}"/modify/"${option}" $@
done done
;; ;;
@ -110,6 +111,7 @@ if [ $# -gt 1 ]; then
if [ -d resources/packages/"${package}"/modify ]; then if [ -d resources/packages/"${package}"/modify ]; then
pkg_dir=resources/packages/"${package}" pkg_dir=resources/packages/"${package}"
if [ -f "${pkg_dir}"/modify/"${option}" ]; then if [ -f "${pkg_dir}"/modify/"${option}" ]; then
# shellcheck disable=SC2068
"${pkg_dir}"/modify/"${option}" $@ "${pkg_dir}"/modify/"${option}" $@
else else
help help

View File

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