From b9b83f38706429064de97452ac42080962ad0e57 Mon Sep 17 00:00:00 2001 From: magges Date: Mon, 6 Jul 2026 00:12:43 +0200 Subject: [PATCH] Unshallow Mesa history for apt versioning --- scripts/build-mesa-opt.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/build-mesa-opt.sh b/scripts/build-mesa-opt.sh index fbbc5c1..777a84a 100644 --- a/scripts/build-mesa-opt.sh +++ b/scripts/build-mesa-opt.sh @@ -69,6 +69,14 @@ export LD_LIBRARY_PATH="${PREREQ_DIR}${INSTALL_PREFIX}/lib/x86_64-linux-gnu:${PR git clone --depth 1 --branch "${UPSTREAM_REF}" "${UPSTREAM_GIT_URL}" "${SRC_DIR}" +# The apt version and release notes need more than a shallow HEAD. Expand the +# clone so commit counts and previous-release comparisons are monotonic. +if [[ "$(git -C "${SRC_DIR}" rev-parse --is-shallow-repository)" == "true" ]]; then + git -C "${SRC_DIR}" fetch --unshallow --tags +else + git -C "${SRC_DIR}" fetch --tags +fi + detect_upstream_version() { local source_dir="${1}"