From a4b5d0426d5f97020efff6d21234960bb566ec78 Mon Sep 17 00:00:00 2001 From: JinwooHwang Date: Tue, 8 Sep 2026 09:26:53 -0400 Subject: [PATCH] GEODE-10636: Sort the mirror keep-list before trimming to the newest releases The awk END block emits the latest patch per minor line in unspecified order, so tail took an arbitrary subset and could drop a current release from the mirrors. Sort numerically before trimming. --- dev-tools/release/promote_rc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev-tools/release/promote_rc.sh b/dev-tools/release/promote_rc.sh index af48a4c4de13..0bbbdb2e5cb3 100755 --- a/dev-tools/release/promote_rc.sh +++ b/dev-tools/release/promote_rc.sh @@ -627,7 +627,8 @@ svn update #identify the latest patch release for "N-2" (the latest 3 major.minor releases), remove anything else from mirrors (all releases remain available on non-mirrored archive site) RELEASES_TO_KEEP=3 set +x -ls | awk -F. '/^[0-9]/{print 1000000*$1+1000*$2+$3,$1"."$2"."$3}'| sort -n | awk '{mm=$2;sub(/\.[^.]*$/,"",mm);V[mm]=$2}END{for(v in V){print V[v]}}'|tail -$RELEASES_TO_KEEP > ../keep +#the awk END block emits the per-line latest patch in unspecified order, so sort numerically before taking the newest few +ls | awk -F. '/^[0-9]/{print 1000000*$1+1000*$2+$3,$1"."$2"."$3}'| sort -n | awk '{mm=$2;sub(/\.[^.]*$/,"",mm);V[mm]=$2}END{for(v in V){print V[v]}}'| sort -t. -k1,1n -k2,2n -k3,3n |tail -$RELEASES_TO_KEEP > ../keep echo Keeping releases: $(cat ../keep) rm -f ../did.remove (ls | grep '^[0-9]'; cat ../keep ../keep)|sort|uniq -u|while read oldVersion; do