Skip to content

Commit cde742a

Browse files
committed
Use jq's IN() instead of index()
The end result is the same, but the construction is more ergonomic.
1 parent 39c19b7 commit cde742a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Dockerfile-linux.template

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ RUN set -eux; \
103103
"$APACHE_LOCK_DIR" \
104104
"$APACHE_RUN_DIR" \
105105
"$APACHE_LOG_DIR" \
106-
{{ if [ "bullseye" ] | index(env.suite) then "" else ( -}}
106+
{{ if env.suite == "bullseye" then "" else ( -}}
107107
# https://salsa.debian.org/apache-team/apache2/-/commit/b97ca8714890ead1ba6c095699dde752e8433205
108108
"$APACHE_RUN_DIR/socks" \
109109
{{ ) end -}}
@@ -326,7 +326,7 @@ RUN set -eux; \
326326
# https://github.com/docker-library/php/issues/822
327327
--with-pic \
328328
\
329-
{{ if [ "8.1" ] | index(env.version | rtrimstr("-rc")) then ( -}}
329+
{{ if env.version | rtrimstr("-rc") == "8.1" then ( -}}
330330
# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236).
331331
--enable-ftp \
332332
{{ ) else "" end -}}
@@ -348,7 +348,7 @@ RUN set -eux; \
348348
--with-readline \
349349
--with-zlib \
350350
\
351-
{{ if [ "cli", "zts" ] | index(env.variant) then ( -}}
351+
{{ if env.variant | IN("cli", "zts") then ( -}}
352352
# https://github.com/docker-library/php/pull/1259
353353
--enable-phpdbg \
354354
--enable-phpdbg-readline \
@@ -360,7 +360,7 @@ RUN set -eux; \
360360
# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
361361
--with-pear \
362362
\
363-
{{ if [ "8.1", "8.2" ] | index(env.version | rtrimstr("-rc")) then ( -}}
363+
{{ if env.version | rtrimstr("-rc") | IN("8.1", "8.2") then ( -}}
364364
# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+)
365365
# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c
366366
# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib
@@ -374,7 +374,7 @@ RUN set -eux; \
374374
--with-libdir="lib/$debMultiarch" \
375375
{{ ) end -}}
376376
{{ # https://github.com/docker-library/php/issues/280 -}}
377-
{{ if [ "cli", "zts" ] | index(env.variant) then "" else ( -}}
377+
{{ if env.variant | IN("cli", "zts") then "" else ( -}}
378378
\
379379
--disable-cgi \
380380
{{ ) end -}}
@@ -397,7 +397,7 @@ RUN set -eux; \
397397
--enable-zts \
398398
# https://externals.io/message/118859
399399
--disable-zend-signals \
400-
{{ if [ "8.1", "8.2" ] | index(env.version | rtrimstr("-rc")) then ( -}}
400+
{{ if env.version | rtrimstr("-rc") | IN("8.1", "8.2") then ( -}}
401401
--enable-zend-max-execution-timers \
402402
{{ ) else "" end -}}
403403
{{ ) else "" end -}}

0 commit comments

Comments
 (0)