armbian-next: optimize for CONFIG_DEFS_ONLY=yes, skipping stacktraces/git info

This commit is contained in:
Ricardo Pardini 2023-01-15 05:00:59 +01:00
parent b7fa6fa8b0
commit 2a68cc6e9e
No known key found for this signature in database
GPG Key ID: 3D38CA12A66C5D02
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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