From b7aa889e19bd97177865e5edba05e72ff4caa951 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Tue, 3 Feb 2026 22:54:29 +0100 Subject: [PATCH] support/br2-external: fix remaining shellcheck errors Boring changes: either do what shellcheck suggested, or comment why we don't want to fix the code. Signed-off-by: Yann E. MORIN Signed-off-by: Romain Naour (cherry picked from commit 72e068001bf88b075abbe230b9ad1b7240c4754b) Signed-off-by: Thomas Perale --- .checkpackageignore | 1 - support/scripts/br2-external | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.checkpackageignore b/.checkpackageignore index 695e0d50c6..fabd3833a3 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -1071,7 +1071,6 @@ support/libtool/buildroot-libtool-v2.4.4.patch lib_patch.ApplyOrder lib_patch.Up support/libtool/buildroot-libtool-v2.4.patch lib_patch.ApplyOrder lib_patch.Sob lib_patch.Upstream support/misc/relocate-sdk.sh Shellcheck support/scripts/apply-patches.sh Shellcheck -support/scripts/br2-external Shellcheck support/scripts/check-bin-arch Shellcheck support/scripts/check-host-rpath Shellcheck support/scripts/expunge-gconv-modules Shellcheck diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 6d4fc1a791..474feaded7 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -34,6 +34,7 @@ main() { error "Cannot create output directory '%s'\n" "${outputdir}" fi + # shellcheck disable=SC2068 # We do want to split on spaces do_validate "${outputdir}" ${@//:/ } do_mk "${outputdir}" do_kconfig "${outputdir}" @@ -71,7 +72,7 @@ do_validate_one() { if [ ! -d "${br2_ext}" ]; then error "'%s': no such file or directory\n" "${br2_ext}" fi - if [ ! -r "${br2_ext}" -o ! -x "${br2_ext}" ]; then + if [ ! -r "${br2_ext}" ] || [ ! -x "${br2_ext}" ]; then error "'%s': permission denied\n" "${br2_ext}" fi if [ ! -f "${br2_ext}/external.desc" ]; then @@ -106,9 +107,9 @@ do_validate_one() { br2_ext="$( cd "${br2_ext}"; pwd )" br2_ver="$( support/scripts/setlocalversion "${br2_ext}" )" BR2_EXT_NAMES+=( "${br2_name}" ) - eval BR2_EXT_PATHS_${br2_name}="\"\${br2_ext}\"" - eval BR2_EXT_VERS_${br2_name}="\"\${br2_ver}\"" - eval BR2_EXT_DESCS_${br2_name}="\"\${br2_desc:-\${br2_name}}\"" + eval "BR2_EXT_PATHS_${br2_name}=\"\${br2_ext}\"" + eval "BR2_EXT_VERS_${br2_name}=\"\${br2_ver}\"" + eval "BR2_EXT_DESCS_${br2_name}=\"\${br2_desc:-\${br2_name}}\"" } # Generate the .mk snippet that defines makefile variables @@ -272,7 +273,7 @@ do_kconfig() { printf 'endmenu\n' >>"${outputdir}/.br2-external.in.menus" } +# shellcheck disable=SC2059 # fmt *is* a format error() { local fmt="${1}"; shift; printf "BR2_EXTERNAL_ERROR = ${fmt}" "${@}"; exit 1; } -my_name="${0##*/}" main "${@}"