Skip to content

Commit

Permalink
Use jq's IN() instead of index()
Browse files Browse the repository at this point in the history
The end result is the same, but the construction is more ergonomic.
  • Loading branch information
tianon committed Oct 16, 2024
1 parent cc2dc88 commit ada4dca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Dockerfile-curl.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ RUN set -eux; \
curl \
gnupg \
netbase \
{{ if [
{{ if env.codename | IN(
# we want versions of "sq" that contain https://gitlab.com/sequoia-pgp/sequoia/-/commit/b41e1504cd29097328cb21f95808c9972188499e (and thus "sq keyserver" subcommands; 0.26+)
# https://packages.debian.org/sq
"bullseye", # 0.24
# https://packages.ubuntu.com/sq
"jammy", # 0.25
"focal", # no sq
empty # trailing comma
] | index(env.codename) then "" else ( -}}
) then "" else ( -}}
sq \
{{ ) end -}}
wget \
Expand Down
6 changes: 1 addition & 5 deletions Dockerfile-scm.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ FROM buildpack-deps:{{ env.codename }}-curl
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
{{
if [
"focal", "groovy"
] | index(env.codename) then (
-}}
{{ if env.codename | IN("focal", "groovy") then ( -}}
bzr \
{{ ) else "" end -}}
git \
Expand Down

0 comments on commit ada4dca

Please sign in to comment.