builder: add bootstrap-chroot support for mock

fixes https://pagure.io/koji/issue/1017
This commit is contained in:
Aron Parsons 2020-01-23 23:12:35 -05:00 committed by Tomas Kopecek
parent be16251b41
commit 1f1da58ec2
2 changed files with 10 additions and 1 deletions

View file

@ -548,7 +548,13 @@ class BuildRoot(object):
return koji.pathinfo.taskrelpath(self.task_id)
def init(self):
rv = self.mock(['--init'])
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)
if rv:
self.expire()

View file

@ -394,6 +394,9 @@ environment follows:
* `mock.new_chroot` - 0/1 value. If it is set, `--new-chroot` or
`--old-chroot` option is appended to any mock call. If it is not set,
mock's default behavior is used.
* `mock.bootstrap_chroot` - 0/1 value. If it is set, `--bootstrap-chroot`
is appended to the mock init call. This tells mock to build in two stages,
using chroot rpm for creating the build chroot
You may also specify per-tag environment variables for mock to use.
For example, to set the CC environment variable to clang, you could