armbian-next: shellcheck: squash more shellcheck warnings; some long-lost variables being used; some unset's that are better reset's, etc

This commit is contained in:
Ricardo Pardini
2023-01-30 21:34:10 +01:00
parent 2767cf8fc2
commit 388c76c91b
6 changed files with 6 additions and 6 deletions

View File

@@ -15,6 +15,6 @@ function post_install_kernel_debs__build_nvidia_kernel_module() {
# chroot_sdcard_apt_get_install() is in lib/logging/runners.sh which handles "running" of stuff nicely. # chroot_sdcard_apt_get_install() is in lib/logging/runners.sh which handles "running" of stuff nicely.
# chroot_sdcard_apt_get_install() -> chroot_sdcard_apt_get() -> chroot_sdcard() -> run_host_command_logged_raw() # chroot_sdcard_apt_get_install() -> chroot_sdcard_apt_get() -> chroot_sdcard() -> run_host_command_logged_raw()
# it handles bash-specific quoting issues, apt proxies, logging, and errors. # it handles bash-specific quoting issues, apt proxies, logging, and errors.
declare -agx if_error_find_files_sdcard=("/var/lib/dkms/nvidia/*/build/make.log") declare -ag if_error_find_files_sdcard=("/var/lib/dkms/nvidia/*/build/make.log")
chroot_sdcard_apt_get_install "nvidia-dkms-${NVIDIA_DRIVER_VERSION}" "nvidia-driver-${NVIDIA_DRIVER_VERSION}" nvidia-settings chroot_sdcard_apt_get_install "nvidia-dkms-${NVIDIA_DRIVER_VERSION}" "nvidia-driver-${NVIDIA_DRIVER_VERSION}" nvidia-settings
} }

View File

@@ -10,7 +10,7 @@ function extension_finish_config__build_zfs_kernel_module() {
function post_install_kernel_debs__build_zfs_kernel_module() { function post_install_kernel_debs__build_zfs_kernel_module() {
[[ "${INSTALL_HEADERS}" != "yes" ]] || [[ "${KERNEL_HAS_WORKING_HEADERS}" != "yes" ]] && return 0 [[ "${INSTALL_HEADERS}" != "yes" ]] || [[ "${KERNEL_HAS_WORKING_HEADERS}" != "yes" ]] && return 0
display_alert "Install ZFS packages, will build kernel module in chroot" "${EXTENSION}" "info" display_alert "Install ZFS packages, will build kernel module in chroot" "${EXTENSION}" "info"
declare -agx if_error_find_files_sdcard=("/var/lib/dkms/zfs/*/build/*.log") declare -ag if_error_find_files_sdcard=("/var/lib/dkms/zfs/*/build/*.log")
# See https://github.com/zfsonlinux/pkg-zfs/issues/69 for a bug with leaking env vars. # See https://github.com/zfsonlinux/pkg-zfs/issues/69 for a bug with leaking env vars.
use_clean_environment="yes" chroot_sdcard_apt_get_install "zfs-dkms zfsutils-linux" use_clean_environment="yes" chroot_sdcard_apt_get_install "zfs-dkms zfsutils-linux"
} }

View File

@@ -295,7 +295,7 @@ function compile_uboot() {
display_alert "Extensions: custom uboot built by extension" "not building regular uboot" "debug" display_alert "Extensions: custom uboot built by extension" "not building regular uboot" "debug"
fi fi
display_alert "Preparing u-boot general packaging. all_worked:${all_worked} any_worked:${any_worked} " "${version} ${target_make}" display_alert "Preparing u-boot general packaging" "${version} ${target_make}"
# set up postinstall script # @todo: extract into a tinkerboard extension # set up postinstall script # @todo: extract into a tinkerboard extension
if [[ $BOARD == tinkerboard ]]; then if [[ $BOARD == tinkerboard ]]; then

View File

@@ -113,7 +113,7 @@ function interactive_desktop_main_configuration() {
options+=("${config_filename}" "${config_name} configuration") options+=("${config_filename}" "${config_name} configuration")
done done
dialog_menu "Choose the desktop environment config" "$backtitle" "Select the configuration for this environment.\nThese are sourced from ${desktop_environment_config_dir}" "${options[@]}" dialog_menu "Choose the desktop environment config" "$backtitle" "Select the configuration for this environment." "${options[@]}"
DESKTOP_ENVIRONMENT_CONFIG_NAME="${DIALOG_MENU_RESULT}" DESKTOP_ENVIRONMENT_CONFIG_NAME="${DIALOG_MENU_RESULT}"
unset options unset options

View File

@@ -211,7 +211,7 @@ function run_host_command_logged_raw() {
function logging_clear_run_command_error_info() { function logging_clear_run_command_error_info() {
# Unset those globals; they're only valid for the first invocation of a runner helper function after they're set. # Unset those globals; they're only valid for the first invocation of a runner helper function after they're set.
unset if_error_detail_message unset if_error_detail_message
unset if_error_find_files_sdcard # remember, this is global. declare -ag if_error_find_files_sdcard=() # declare as global, empty array
} }
function logging_enrich_run_command_error_info() { function logging_enrich_run_command_error_info() {

View File

@@ -272,7 +272,7 @@ function config_post_main() {
function set_distribution_status() { function set_distribution_status() {
local distro_support_desc_filepath="${SRC}/config/distributions/${RELEASE}/support" local distro_support_desc_filepath="${SRC}/config/distributions/${RELEASE}/support"
if [[ ! -f "${distro_support_desc_filepath}" ]]; then if [[ ! -f "${distro_support_desc_filepath}" ]]; then
exit_with_error "Distribution ${distribution_name} does not exist" exit_with_error "Distribution dir '${distro_support_desc_filepath}' does not exist"
else else
DISTRIBUTION_STATUS="$(cat "${distro_support_desc_filepath}")" DISTRIBUTION_STATUS="$(cat "${distro_support_desc_filepath}")"
fi fi