extend to allow also boostrap-image

Fixes: https://pagure.io/koji/issue/1017
This commit is contained in:
Tomas Kopecek 2020-04-20 15:39:16 +02:00
parent 1f1da58ec2
commit d1cf0040c8
3 changed files with 45 additions and 12 deletions

View file

@ -300,6 +300,10 @@ class BuildRoot(object):
opts['tag_macros'][macro] = self.config['extra'][key]
elif key.startswith('rpm.env.'):
opts['tag_envvars'][key[8:]] = self.config['extra'][key]
if 'mock.bootstrap_chroot' in self.config['extra']:
opts['bootstrap_chroot'] = bool(self.config['extra']['mock.bootstrap_chroot'])
opts['bootstrap_image'] = self.config['extra'].get('mock.bootstrap_image')
output = koji.genMockConfig(self.name, self.br_arch, managed=True, **opts)
# write config
@ -548,13 +552,7 @@ class BuildRoot(object):
return koji.pathinfo.taskrelpath(self.task_id)
def init(self):
args = ['--init']
if 'mock.bootstrap_chroot' in self.config['extra']:
if self.config['extra']['mock.bootstrap_chroot']:
args.append('--bootstrap-chroot')
rv = self.mock(args)
rv = self.mock(['--init'])
if rv:
self.expire()