From 0e8bddd1e8608b279dee1fddfc9afc45ed000b3d Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Wed, 4 Jan 2023 10:24:49 +0100 Subject: [PATCH] armbian-next: `cli`: `config-dump`: can now run on any bash/coreutils-enabled machine; remove some useless vars from dump --- lib/functions/cli/cli-configdump.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/functions/cli/cli-configdump.sh b/lib/functions/cli/cli-configdump.sh index e3585e3ad5..a311a9fa98 100644 --- a/lib/functions/cli/cli-configdump.sh +++ b/lib/functions/cli/cli-configdump.sh @@ -1,11 +1,20 @@ function cli_config_dump_pre_run() { declare -g CONFIG_DEFS_ONLY='yes' - # "gimme root on a Linux machine" - cli_standard_relaunch_docker_or_sudo } function cli_config_dump_run() { # configuration etc - it initializes the extension manager - do_capturing_defs prepare_and_config_main_build_single # this sets CAPTURED_VARS - echo "${CAPTURED_VARS}" # to stdout! + do_capturing_defs config_and_remove_useless < /dev/null # this sets CAPTURED_VARS; the < /dev/null is take away the terminal from stdin + echo "${CAPTURED_VARS}" # to stdout! +} + +function config_and_remove_useless() { + prepare_and_config_main_build_single + unset FINALDEST + unset FINAL_HOST_DEPS + unset HOOK_ORDER HOOK_POINT HOOK_POINT_TOTAL_FUNCS + unset REPO_CONFIG REPO_STORAGE + unset DEB_STORAGE + unset RKBIN_DIR + unset ROOTPWD }