Skip to content

Commit 66d705f

Browse files
committed
Fix compatibility with Jinja <= 2.9
The namespace() feature works since 2.10+. Also update common for pretty-printing output of the 'make generate' rule.
1 parent 6f27a04 commit 66d705f

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

specs/multispec.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ specs:
1717
'httpd24-mod_auth_kerb', 'httpd24-mod_ldap', 'httpd24-mod_session',
1818
'atlas-devel', 'gcc-gfortran', 'libffi-devel', 'libtool-ltdl enchant']
1919
extra_pkgs:
20-
- version: "2.7"
21-
value: ['libjpeg-turbo', 'libjpeg-turbo-devel']
20+
"2.7": ['libjpeg-turbo', 'libjpeg-turbo-devel']
2221

2322
rhel:
2423
distros:

src/Dockerfile.template

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{% import "src/common.tpl" as common with context %}
22
{% import "src/" + config.os.id + "/macros.tpl" as macros with context %}
3-
{% set ns = namespace(extra_pkgs=[]) %}
4-
{% for item in spec.extra_pkgs %}
5-
{% if spec.version == item.version %}
6-
{% set ns.extra_pkgs = item.value %}
7-
{% endif %}
8-
{% endfor %}
93
{% if config.os.id == 'rhel' and spec.base_img_version %}
104
{% set img_tag = spec.base_img_version %}
115
{% elif spec.img_tag %}
@@ -43,7 +37,8 @@ LABEL summary="$SUMMARY" \
4337
io.openshift.expose-services="8080:http" \
4438
io.openshift.tags="builder,python,python{{ spec.short_ver }},rh-python{{ spec.short_ver }}" \
4539
{{ macros.labels(spec) }}
46-
RUN INSTALL_PKGS="{{ common.list_pkgs(ns.extra_pkgs + spec.python_pkgs + spec.base_pkgs) -}}
40+
{% set extra_pkgs = spec.extra_pkgs[spec.version] if spec.extra_pkgs and spec.extra_pkgs[spec.version] else [] %}
41+
RUN INSTALL_PKGS="{{ common.list_pkgs(extra_pkgs + spec.python_pkgs + spec.base_pkgs) -}}
4742
{% if spec.preinstall_cmd %}
4843
{{ common.preinstall_cmd(spec) -}}
4944
{% endif %}

0 commit comments

Comments
 (0)