From 2426c0f05bc9ff8ccb664c2706aba8a0a8e69ddd Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Wed, 2 Oct 2024 00:17:34 +0200 Subject: [PATCH] armbian-bsp-cli-deb: fix shellcheck breakage; fixes #7303 - also, shellfmt Fixes: db2b432d1897308391969456e6cfe5a6d73f9735 --- lib/functions/bsp/armbian-bsp-cli-deb.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/functions/bsp/armbian-bsp-cli-deb.sh b/lib/functions/bsp/armbian-bsp-cli-deb.sh index 17c8971a739f..cf6f9774d8b2 100644 --- a/lib/functions/bsp/armbian-bsp-cli-deb.sh +++ b/lib/functions/bsp/armbian-bsp-cli-deb.sh @@ -176,9 +176,10 @@ function compile_armbian-bsp-cli() { # copy distribution support and upgrade status # this information is used in motd to show status and within armbian-config to perform upgrades - local releases=($(find ${SRC}/config/distributions -iname '*order*' -exec echo {} \; -exec cat {} \; | xargs -n2 -d'\n' | sort -nk2 | sed "s/\/order.*//g")) + declare -a releases=() + mapfile -t releases < <(for relorder in "${SRC}"/config/distributions/*/order; do echo "${relorder} $(xargs echo < "${relorder}")"; done | sort -nk2 | sed "s/\/order.*//g") for i in "${releases[@]}"; do - echo "$(echo $i | sed 's/.*\///')=$(cat $i/support)$(echo ";upgrade" | sed 's/.*\///')=$(cat $i/upgrade)" >> "${destination}"/etc/armbian-distribution-status + echo "$(echo "$i" | sed 's/.*\///')=$(cat "$i"/support)$(echo ";upgrade" | sed 's/.*\///')=$(cat "$i"/upgrade)" >> "${destination}"/etc/armbian-distribution-status done # execute $LINUXFAMILY-specific tweaks @@ -216,12 +217,12 @@ function compile_armbian-bsp-cli() { # if freeze variable is removed, upgrade becomes possible again if [[ "${BETA}" != "yes" ]]; then for pin_variants in $(echo $KERNEL_UPGRADE_FREEZE | sed "s/,/ /g"); do - extracted_pins=(${pin_variants//@/ }) + extracted_pins=(${pin_variants//@/ }) if [[ "${BRANCH}-${LINUXFAMILY}" == "${extracted_pins[0]}" ]]; then cat <<- EOF >> "${destination}"/etc/apt/preferences.d/frozen-armbian - Package: linux-*-${extracted_pins[0]} - Pin: version ${extracted_pins[1]} - Pin-Priority: 999 + Package: linux-*-${extracted_pins[0]} + Pin: version ${extracted_pins[1]} + Pin-Priority: 999 EOF fi done @@ -455,7 +456,7 @@ function board_side_bsp_cli_postinst_finish() { if [ ! -f "/etc/default/armbian-zram-config" ] && [ -f /etc/default/armbian-zram-config.dpkg-dist ]; then mv /etc/default/armbian-zram-config.dpkg-dist /etc/default/armbian-zram-config fi - if [ ! -f "/etc/default/armbian-firstrun" ]; then + if [ ! -f "/etc/default/armbian-firstrun" ]; then mv /etc/default/armbian-firstrun.dpkg-dist /etc/default/armbian-firstrun fi