Skip to content

Commit

Permalink
rpmbuild: no Jinja-vars in config_opts keys
Browse files Browse the repository at this point in the history
The Jinja statements are only expanded in the values of the config_opts
dictionary, not in the keys. The new mock-core-configs version 40.2
contains a Jinja condition in the package_manager value. Therefore, we
cannot simply use it as a key in config_opts.

Since yum.conf and dnf.conf are aliases (starting from Mock 2.1), and
dnf5.conf (starting from Mock 5.0+), we can avoid using the variable as
a key entirely.

Relates: rpm-software-management/mock@5d620ad326d
Relates: rpm-software-management/mock#1332
  • Loading branch information
praiskup committed Feb 21, 2024
1 parent 9fcb724 commit 912196b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rpmbuild/mock-custom-build.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ config_opts['macros']['{{ key }}'] = '{{ value }}'
{%- endfor %}

{% if repos %}
config_opts[f"{config_opts.package_manager}.conf"] += """
config_opts["dnf.conf"] += """
{% for repo in repos %}
[{{ repo["id"] }}]
name='{{ repo["name"] }}'
Expand Down
2 changes: 1 addition & 1 deletion rpmbuild/mock.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ config_opts['module_setup_commands'] = {{ modules |pprint }}
{%- endif %}

{% if repos %}
config_opts[f"{config_opts.package_manager}.conf"] += """
config_opts["dnf.conf"] += """
{% for repo in repos %}
[{{ repo["id"] }}]
name='{{ repo["name"] }}'
Expand Down

0 comments on commit 912196b

Please sign in to comment.