From 8a7e8c6cd8d81acab1b75fd9ed19a50c85eda4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Van=C4=9Bk?= Date: Tue, 24 Mar 2026 13:41:36 +0100 Subject: [PATCH 1/2] refactor: use bash array for packages in install_dependencies Use an array instead of a plain string to avoid word-splitting issues and move apt update before apt install for clarity. --- build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 6228e60..761b255 100755 --- a/build.sh +++ b/build.sh @@ -8,14 +8,14 @@ TARGET_ARCH="${TARGET_ARCH:-x86_64}" HOST_ARCH="$(uname -m)" function install_dependencies { - apt update - local packages="bc flex bison gcc make libelf-dev libssl-dev squashfs-tools busybox-static tree cpio curl patch" + local packages=( + bc flex bison gcc make libelf-dev libssl-dev squashfs-tools busybox-static tree cpio curl patch + ) - if [[ "$TARGET_ARCH" == "arm64" && "$HOST_ARCH" != "aarch64" ]]; then - packages="$packages gcc-aarch64-linux-gnu" - fi + [[ "${TARGET_ARCH}" == "arm64" && "${HOST_ARCH}" != "aarch64" ]] && packages+=( gcc-aarch64-linux-gnu ) - apt install -y $packages + apt update + apt install -y "${packages[@]}" } # prints the git tag corresponding to the newest and best matching the provided kernel version $1 From 0d8dc0e2428c011bbb0b770d65a27f01b2371cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Van=C4=9Bk?= Date: Tue, 24 Mar 2026 13:52:24 +0100 Subject: [PATCH 2/2] chore: sort package list alphabetically in install_dependencies --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 761b255..2bcde4f 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ HOST_ARCH="$(uname -m)" function install_dependencies { local packages=( - bc flex bison gcc make libelf-dev libssl-dev squashfs-tools busybox-static tree cpio curl patch + bc bison busybox-static cpio curl flex gcc libelf-dev libssl-dev make patch squashfs-tools tree ) [[ "${TARGET_ARCH}" == "arm64" && "${HOST_ARCH}" != "aarch64" ]] && packages+=( gcc-aarch64-linux-gnu )