Skip to content

Commit 92d8c61

Browse files
authored
Merge pull request #165 from infosiftr/jq-IN
Use jq's `IN()` instead of `index()`
2 parents cc2dc88 + c708f4c commit 92d8c61

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

Dockerfile-curl.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ RUN set -eux; \
88
curl \
99
gnupg \
1010
netbase \
11-
{{ if [
11+
{{ if env.codename | IN(
1212
# we want versions of "sq" that contain https://gitlab.com/sequoia-pgp/sequoia/-/commit/b41e1504cd29097328cb21f95808c9972188499e (and thus "sq keyserver" subcommands; 0.26+)
1313
# https://packages.debian.org/sq
1414
"bullseye", # 0.24
1515
# https://packages.ubuntu.com/sq
1616
"jammy", # 0.25
1717
"focal", # no sq
1818
empty # trailing comma
19-
] | index(env.codename) then "" else ( -}}
19+
) then "" else ( -}}
2020
sq \
2121
{{ ) end -}}
2222
wget \

Dockerfile-scm.template

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ FROM buildpack-deps:{{ env.codename }}-curl
44
RUN set -eux; \
55
apt-get update; \
66
apt-get install -y --no-install-recommends \
7-
{{
8-
if [
9-
"focal", "groovy"
10-
] | index(env.codename) then (
11-
-}}
7+
{{ if env.codename | IN("focal", "groovy") then ( -}}
128
bzr \
139
{{ ) else "" end -}}
1410
git \

shared.jq

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def apt_get_dist_clean:
2-
if [
2+
if env.codename | IN(
33
# only suites with APT 2.7.8+ have "apt-get dist-clean"
44
# https://tracker.debian.org/news/1492892/accepted-apt-278-source-into-unstable/
55

@@ -14,7 +14,7 @@ def apt_get_dist_clean:
1414
"focal",
1515

1616
empty
17-
] | index(env.codename) then
17+
) then
1818
"rm -rf /var/lib/apt/lists/*"
1919
else
2020
"apt-get dist-clean"

0 commit comments

Comments
 (0)