Add new option for mock option - bootstrap_image_ready

Fixes: https://pagure.io/koji/issue/3958
This commit is contained in:
Jana Librova 2025-01-06 13:33:31 +01:00 committed by Tomas Kopecek
parent 9ba4398211
commit 1c923edcc8
4 changed files with 12 additions and 0 deletions

View file

@ -469,6 +469,8 @@ class BuildRoot(object):
cmd.append('--new-chroot')
else:
cmd.append('--old-chroot')
if self.config['extra'].get('mock.bootstrap_image_ready', False):
cmd.append('--bootstrap-image-ready')
cmd.extend(args)
self.logger.info(format_shell_cmd(cmd))
workdir = getattr(self, 'workdir', None)

View file

@ -1188,6 +1188,9 @@ def anon_handle_mock_config(goptions, session, args):
opts['bootstrap_image'] = buildcfg['extra']['mock.bootstrap_image']
else:
opts['use_bootstrap_image'] = False
if 'mock.bootstrap_image_ready' in buildcfg['extra']:
opts['bootstrap_image_ready'] = bool(buildcfg['extra']['mock.bootstrap_image_ready'])
# no else part as it would be driven by site-defaults.cfg
if 'mock.use_bootstrap' in buildcfg['extra']:
opts['use_bootstrap'] = buildcfg['extra']['mock.use_bootstrap']
if 'mock.module_setup_commands' in buildcfg['extra']:

View file

@ -437,6 +437,11 @@ environment follows:
- this option will automatically turn ``mock.use_bootstrap`` (this is how
it is implemented in mock)
* ``mock.bootstrap_image_ready`` - For the specification that we are ready for bootstrapping.
If we want to specify, that we are ready for bootstrapping, we need to know that these
two packages `python3-dnf` and `python3-dnf-plugins-coreare installed in the container.
* ``mock.module_setup_commands`` - commands for configuring the modules active
in a buildroot. Available in `mock 2.4
<https://github.com/rpm-software-management/mock/wiki/Release-Notes-2.4>`__.

View file

@ -254,6 +254,7 @@ config_opts['macros']['%distribution'] = 'Koji Testing'
'mock.yum.best': 10,
'mock.bootstrap_image': 'bootstrap_image_content',
'mock.use_bootstrap': True,
'mock.bootstrap_image_ready': True,
'mock.module_setup_commands': 'module_setup_commands_content',
'mock.releasever': 'releasever_content',
},
@ -297,6 +298,7 @@ config_opts['macros']['%distribution'] = 'Koji Testing'
'releasever': 'releasever_content',
'use_bootstrap': True,
'use_bootstrap_image': True,
'bootstrap_image_ready': True,
'yum_best': 10,
})