From 2a68cc6e9e8180d611782aa20e4091a0ef326437 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Sun, 15 Jan 2023 05:00:59 +0100 Subject: [PATCH] armbian-next: optimize for `CONFIG_DEFS_ONLY=yes`, skipping stacktraces/git info --- lib/functions/configuration/main-config.sh | 3 ++- lib/functions/logging/stacktraces.sh | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/functions/configuration/main-config.sh b/lib/functions/configuration/main-config.sh index 319109e071..d5340ce749 100644 --- a/lib/functions/configuration/main-config.sh +++ b/lib/functions/configuration/main-config.sh @@ -56,7 +56,8 @@ function do_main_configuration() { [[ -z "${CHROOT_CACHE_VERSION}" ]] && CHROOT_CACHE_VERSION=7 - if [[ -d "${SRC}/.git" ]]; then + if [[ -d "${SRC}/.git" && "${CONFIG_DEFS_ONLY}" != "yes" ]]; then # don't waste time if only gathering config defs + display_alert "Getting git info for repo" "${SRC}" "debug" BUILD_REPOSITORY_URL="$(git remote get-url "$(git remote | grep origin || true)" || true)" # ignore all errors BUILD_REPOSITORY_COMMIT="$(git describe --match=d_e_a_d_b_e_e_f --always --dirty || true)" # ignore error fi diff --git a/lib/functions/logging/stacktraces.sh b/lib/functions/logging/stacktraces.sh index a08c03499d..de1d3e4c4e 100644 --- a/lib/functions/logging/stacktraces.sh +++ b/lib/functions/logging/stacktraces.sh @@ -1,7 +1,8 @@ # Helper function, to get clean "stack traces" that do not include the hook/extension infrastructure code. function get_extension_hook_stracktrace() { - local sources_str="$1" # Give this ${BASH_SOURCE[*]} - expanded - local lines_str="$2" # And this # Give this ${BASH_LINENO[*]} - expanded + [[ "${CONFIG_DEFS_ONLY}" == "yes" ]] && return 0 # don't waste time here + local sources_str="$1" # Give this ${BASH_SOURCE[*]} - expanded + local lines_str="$2" # And this # Give this ${BASH_LINENO[*]} - expanded local sources lines index final_stack="" IFS=' ' read -r -a sources <<< "${sources_str}" IFS=' ' read -r -a lines <<< "${lines_str}" @@ -29,6 +30,7 @@ function get_extension_hook_stracktrace() { } function show_caller_full() { + [[ "${CONFIG_DEFS_ONLY}" == "yes" ]] && return 0 # don't waste time here { local i=1 # skip the first frame local line_no