per-tag configuration of mocks' --new-chroot

This commit is contained in:
Tomas Kopecek 2017-05-19 13:03:47 +02:00 committed by Mike McLean
parent 79560b1647
commit ffb88b93ca
2 changed files with 24 additions and 0 deletions

View file

@ -364,6 +364,11 @@ class BuildRoot(object):
#if self.options.debug_mock:
# cmd.append('--debug')
# TODO: should we pass something like --verbose --trace instead?
if 'mock.new_chroot' in self.config['extra']:
if self.config['extra']['mock.new_chroot']:
cmd.append('--new-chroot')
else:
cmd.append('--old-chroot')
cmd.extend(args)
self.logger.info(' '.join(cmd))
workdir = getattr(self, 'workdir', None)

View file

@ -403,6 +403,25 @@ for example to get the latest buildroot for dist-f12-build run
you will need to pass in --topurl=https://kojipkgs.fedoraproject.org/ to
any mock-config command to get a working mock-config from fedoras koji.
Tuning mock's behaviour per tag
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Few options for mock can be configured per-tag. These options are stored in
tag info's *extra* field. Extra values can be checked via `koji taginfo`
command. Example for forcing `dnf` usage in specific build
environment follows:
::
koji edit-tag dnf-fedora-tag -x mock.package_manager=dnf
* `mock.package_manager` - If this is set, it will override mock's default
package manager. Typically used with `yum` or `dnf` values.
* `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 behaviour is used.
Using Koji to control tasks
^^^^^^^^^^^^^^^^^^^^^^^^^^^