artifact-uboot: add UBOOT_GIT_CACHE_TTL to control git ref memoization (fixes #7710)
Some checks failed
Infrastructure: Dispatch to fork / 📢 Run repository dispatch on fork (push) Has been cancelled
Infrastructure: Mirror to Codeberg / codeberg (push) Has been cancelled
Maintenance: Announce merge / announcepush (push) Has been cancelled
Maintenance: Security scan / Scorecards analysis (push) Has been cancelled

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.
This commit is contained in:
Igor Velkov 2026-04-19 20:38:50 +03:00 committed by Igor
parent 3697435a26
commit 83ddc2204c

View File

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