armbian-next: config: reduce bash scope & remove some vars un-needed outside of config

This commit is contained in:
Ricardo Pardini
2023-01-04 10:22:33 +01:00
parent 166a34da86
commit c33b59d61b
3 changed files with 15 additions and 3 deletions

View File

@@ -14,6 +14,15 @@ function interactive_config_prepare_terminal() {
export backtitle="Armbian building script, https://www.armbian.com | https://docs.armbian.com | (c) 2013-2023 Igor Pecovnik "
}
function interactive_finish() {
unset TTY_X
unset TTY_Y
unset options
unset DIALOG_EXIT_CODE
unset WIP_STATE
unset SHOW_WARNING
}
function interactive_config_ask_kernel() {
interactive_config_ask_kernel_only
interactive_config_ask_kernel_configure

View File

@@ -278,7 +278,7 @@ function do_main_configuration() {
[[ -z $UBOOT_USE_GCC ]] && exit_with_error "Error in configuration: UBOOT_USE_GCC is unset"
[[ -z $KERNEL_USE_GCC ]] && exit_with_error "Error in configuration: KERNEL_USE_GCC is unset"
BOOTCONFIG_VAR_NAME=BOOTCONFIG_${BRANCH^^}
declare BOOTCONFIG_VAR_NAME="BOOTCONFIG_${BRANCH^^}"
[[ -n ${!BOOTCONFIG_VAR_NAME} ]] && BOOTCONFIG=${!BOOTCONFIG_VAR_NAME}
[[ -z $LINUXCONFIG ]] && LINUXCONFIG="linux-${LINUXFAMILY}-${BRANCH}"
[[ -z $BOOTPATCHDIR ]] && BOOTPATCHDIR="u-boot-$LINUXFAMILY"

View File

@@ -57,8 +57,9 @@ function prepare_and_config_main_build_single() {
declare -A dict_all_board_types=() dict_all_board_source_files=() # dictionaries
get_list_of_all_buildable_boards arr_all_board_names "" dict_all_board_types dict_all_board_source_files "" # invoke
BOARD_TYPE="${dict_all_board_types["${BOARD}"]}"
BOARD_SOURCE_FILES="${dict_all_board_source_files["${BOARD}"]}"
declare BOARD_TYPE="${dict_all_board_types["${BOARD}"]}"
declare BOARD_SOURCE_FILES="${dict_all_board_source_files["${BOARD}"]}"
declare BOARD_SOURCE_FILE
declare -a sourced_board_configs=()
for BOARD_SOURCE_FILE in ${BOARD_SOURCE_FILES}; do # No quotes, so expand the space-delimited list
@@ -92,6 +93,8 @@ function prepare_and_config_main_build_single() {
interactive_config_ask_standard_or_minimal
interactive_finish # cleans up vars
#prevent conflicting setup
if [[ $BUILD_DESKTOP == "yes" ]]; then
BUILD_MINIMAL=no