From 01277c131bb5056972cf2a0d51d0302b91c97e75 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jun 23 2017 21:26:39 +0000 Subject: PR#400 per-tag configuration of chroot mock behaviour Merges #400 https://pagure.io/koji/pull-request/400 Fixes #398 https://pagure.io/koji/issue/398 --- diff --git a/builder/kojid b/builder/kojid index 5db734e..f34bff6 100755 --- a/builder/kojid +++ b/builder/kojid @@ -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) diff --git a/docs/source/using_the_koji_build_system.rst b/docs/source/using_the_koji_build_system.rst index d913219..d40e4af 100644 --- a/docs/source/using_the_koji_build_system.rst +++ b/docs/source/using_the_koji_build_system.rst @@ -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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^