grafanaPlugins: prefer per-platform hashes to 'any'

Some packages have both per-platform _and_ an 'any' packages (e.g.
grafana-clickhouse-datasource) and the update script fails for those
cases. Prefer the per-platform packages if available.
This commit is contained in:
Bouke van der Bijl
2026-03-11 11:20:18 +01:00
parent 86096c2291
commit 4fdedf5f08
@@ -35,8 +35,8 @@ update() {
update-source-version $system "grafanaPlugins.${plugin_name}" "$latest_version" "$hash"
}
if echo "$api_response" | jq -e .packages.any > /dev/null; then
# the package contains an "any" package, so there should be only one zipHash.
if echo "$api_response" | jq -e '.packages | select(length == 1) | .any' > /dev/null; then
# the package only contains an "any" package, so there should be only one zipHash.
update "any"
else
update "linux-amd64" "x86_64-linux"