From ee45b5e19d634a8b3a455f6cea0ec878d6a14315 Mon Sep 17 00:00:00 2001 From: Roland Date: Sat, 18 Jul 2026 17:02:10 -0600 Subject: [PATCH] upgrade: force-update the debian12-final tag fetch The Debian 12 guard fetched the cutoff tag with a non-forcing refspec, so a box that had already fetched an earlier `debian12-final` kept its stale local tag ("would clobber existing tag" is rejected). When the tag later moved (e.g. a version-bumped final release), the guard pinned to the OLD target instead of the new one. Force the fetch (+ / --force) so a moved tag wins. Safe: the commit's signature is still verified before checkout. Caught on real Debian 12 hardware (10.0.0.8) after moving the tag for a patch bump; added a sandbox scenario covering the moved-tag/stale-local-tag case. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/upgrade.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 0eb76551..67c124fe 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -58,11 +58,14 @@ debian12_guard() { return 0 fi - # Debian 12 (or older): make sure the cutoff tag is present locally. + # Debian 12 (or older): make sure the cutoff tag is present AND current. # `debian12-final` is off the release line, so a plain fetch of the branch - # would not follow it. - git -C /opt/wrolpi fetch origin "refs/tags/${GUARD_TAG}:refs/tags/${GUARD_TAG}" 2>/dev/null \ - || git -C /opt/wrolpi fetch origin --tags 2>/dev/null || : + # would not follow it. Force (+ / --force) so a moved tag (e.g. a bumped + # final release) overwrites a stale local tag instead of being rejected as + # "would clobber existing tag" — otherwise the guard pins to the old target. + # Safe to force: the commit's signature is verified before checkout below. + git -C /opt/wrolpi fetch origin "+refs/tags/${GUARD_TAG}:refs/tags/${GUARD_TAG}" 2>/dev/null \ + || git -C /opt/wrolpi fetch --force --tags origin 2>/dev/null || : # --verify --quiet: fail cleanly (empty, non-zero) instead of echoing the # unresolved arg when the tag is absent.