Skip to content

Commit

Permalink
Merge pull request #165 from infosiftr/jq-IN
Browse files Browse the repository at this point in the history
Use jq's `IN()` instead of `index()`
  • Loading branch information
tianon authored Oct 16, 2024
2 parents cc2dc88 + c708f4c commit 92d8c61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 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
4 changes: 2 additions & 2 deletions shared.jq
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def apt_get_dist_clean:
if [
if env.codename | IN(
# only suites with APT 2.7.8+ have "apt-get dist-clean"
# https://tracker.debian.org/news/1492892/accepted-apt-278-source-into-unstable/

Expand All @@ -14,7 +14,7 @@ def apt_get_dist_clean:
"focal",

empty
] | index(env.codename) then
) then
"rm -rf /var/lib/apt/lists/*"
else
"apt-get dist-clean"
Expand Down

0 comments on commit 92d8c61

Please sign in to comment.