From 5fc5a4ea489c7bb8bd3de2abcc80b1260311d11c Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 2 Jan 2026 14:42:49 -0800 Subject: [PATCH] Move `variants` calculation into `jq` --- versions.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/versions.sh b/versions.sh index 5bfe73c46..62d4c4977 100755 --- a/versions.sh +++ b/versions.sh @@ -77,36 +77,36 @@ for version in "${versions[@]}"; do ascUrl="$url.asc" fi - variants='[]' - # order here controls the order of the library/ file - for suite in \ - trixie \ - bookworm \ - alpine3.23 \ - alpine3.22 \ - ; do - for variant in cli apache fpm zts; do - if [[ "$suite" = alpine* ]]; then - if [ "$variant" = 'apache' ]; then - continue - fi - fi - export suite variant - variants="$(jq <<<"$variants" -c '. + [ env.suite + "/" + env.variant ]')" - done - done - echo "$version: $fullVersion" export fullVersion url ascUrl sha256 json="$( - jq <<<"$json" -c --argjson variants "$variants" ' + jq <<<"$json" -c ' .[env.version] = { version: env.fullVersion, url: env.url, ascUrl: env.ascUrl, sha256: env.sha256, - variants: $variants, + variants: [ + # order here controls the order of the library/ file + ( + "trixie", + "bookworm", + "alpine3.23", + "alpine3.22", + empty + ) as $suite + | ( + "cli", + "apache", + "fpm", + "zts", + empty + ) as $variant + | if $suite | startswith("alpine") and $variant == "apache" then empty else + "\($suite)/\($variant)" + end + ], } ' )"