From 83ddc2204c0efb8261c3869e2d4eef2adeea4814 Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Sun, 19 Apr 2026 20:38:50 +0300 Subject: [PATCH] artifact-uboot: add UBOOT_GIT_CACHE_TTL to control git ref memoization (fixes #7710) By default the git ref of BOOTSOURCE/BOOTBRANCH is memoized for 3600 seconds, so pushing new commits to a tracked branch is not picked up until the cache expires. Add UBOOT_GIT_CACHE_TTL, mirroring KERNEL_GIT_CACHE_TTL in artifact-kernel.sh, so users can override this timeout (set to a low value or 0 to always re-resolve the upstream SHA1). As suggested by rpardini in armbian/build#7710. --- lib/functions/artifacts/artifact-uboot.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/functions/artifacts/artifact-uboot.sh b/lib/functions/artifacts/artifact-uboot.sh index e1bab6846c..948c83421c 100644 --- a/lib/functions/artifacts/artifact-uboot.sh +++ b/lib/functions/artifacts/artifact-uboot.sh @@ -40,8 +40,14 @@ function artifact_uboot_prepare_version() { declare short_hash_size=4 + declare -i uboot_git_cache_ttl_seconds=3600 # by default + if [[ "${UBOOT_GIT_CACHE_TTL}" != "" ]]; then + uboot_git_cache_ttl_seconds="${UBOOT_GIT_CACHE_TTL}" + display_alert "Setting u-boot git cache TTL to" "${uboot_git_cache_ttl_seconds}" "info" + fi + declare -A GIT_INFO_UBOOT=([GIT_SOURCE]="${BOOTSOURCE}" [GIT_REF]="${BOOTBRANCH}") - run_memoized GIT_INFO_UBOOT "git2info" memoized_git_ref_to_info "include_makefile_body" + memoize_cache_ttl=$uboot_git_cache_ttl_seconds run_memoized GIT_INFO_UBOOT "git2info" memoized_git_ref_to_info "include_makefile_body" debug_dict GIT_INFO_UBOOT # Sanity check, the SHA1 gotta be sane.