Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore PM-specific option specification in mock config #1074

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion ros_buildfarm/templates/release/rpm/mock_config.cfg.em
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
include('/etc/mock/default.cfg')

def _expanded(k, opts):
"""Get a config value and ensure it has been expanded."""
exp, opts['__jinja_expand'] = opts.get('__jinja_expand', False), True
try:
return opts[k]
finally:
opts['__jinja_expand'] = exp

# Change the root name since we're modifying the chroot
config_opts['root'] += '-ros-buildfarm'

Expand All @@ -10,7 +18,13 @@ config_opts['use_bootstrap'] = False
config_opts['chroot_setup_cmd'] += ' python3-rpm-macros'

# Install weak dependencies to get group members
config_opts[f'dnf_builddep_opts'] = config_opts.get(f'dnf_builddep_opts', []) + ['--setopt=install_weak_deps=True']
package_manager = _expanded('package_manager', config_opts)
additional_opts = ['--setopt=install_weak_deps=True']
config_opts[f'{package_manager}_builddep_opts'] = config_opts.get(f'{package_manager}_builddep_opts', []) + additional_opts

# Deal with dnf -> dnf4 transition - see rpm-software-management/mock#1496
if package_manager == 'dnf':
config_opts[f'dnf4_builddep_opts'] = config_opts.get(f'dnf4_builddep_opts', []) + additional_opts

@[if env_vars]@
# Set environment vars from the build config
Expand Down
Loading