PR#2337: align option naming with mock

Merges #2337
https://pagure.io/koji/pull-request/2337

Fixes: #84
https://pagure.io/koji/issue/84
[Feature Request] Allow koji-builder to use Mock's sign plugin to automatically sign package after build
This commit is contained in:
Mike McLean 2020-07-23 11:18:27 -04:00
commit 63834751c3
2 changed files with 12 additions and 12 deletions

View file

@ -296,14 +296,14 @@ class BuildRoot(object):
# Append opts['plugin_conf'] to enable Mock package signing
if 'mock.plugin_conf.sign_enable' in self.config['extra']:
# check rest of configuration
if ('mock.plugin_conf.sign_cmd' not in self.config['extra'] or
'mock.plugin_conf.sign_opts' not in self.config['extra']):
if ('mock.plugin_conf.sign_opts.cmd' not in self.config['extra'] or
'mock.plugin_conf.sign_opts.opts' not in self.config['extra']):
raise koji.GenericError("Tag is not configured properly for mock's sign plugin'")
opts['plugin_conf'] = {
'sign_enable': self.config['extra']['mock.plugin_conf.sign_enable'],
'sign_opts': {
'cmd': self.config['extra']['mock.plugin_conf.sign_cmd'],
'opts': self.config['extra']['mock.plugin_conf.sign_opts'],
'cmd': self.config['extra']['mock.plugin_conf.sign_opts.cmd'],
'opts': self.config['extra']['mock.plugin_conf.sign_opts.opts'],
}
}
if self.internal_dev_setup is not None:

View file

@ -436,14 +436,14 @@ environment follows:
* `mock signing plugin
<https://github.com/rpm-software-management/mock/wiki/Plugin-Sign>`__ -
Options ``mock.plugin_conf.sign_enable``, ``mock.plugin_conf.sign_cmd`` and
``mock.plugin_conf.sign_opts`` are propagated to mock conf to be used by this
plugin. Note, that these tools are run outside of the jailed env. Note, that
this functionality doesn't interfere with koji's standard signing commands
(``import-sig``, ``write-signed-rpm``, etc.). Note, that rpmsign vs gpg must
be configured correctly. If it is not it a) can silently ignore problems
during signing b) can hang forever when e.g. gpg password store is not
accessible.
Options ``mock.plugin_conf.sign_enable``, ``mock.plugin_conf.sign_opts.cmd``
and ``mock.plugin_conf.sign_opts.opts`` are propagated to mock conf to be used
by this plugin. Note, that these tools are run outside of the jailed env.
Note, that this functionality doesn't interfere with koji's standard signing
commands (``import-sig``, ``write-signed-rpm``, etc.). Note, that rpmsign vs
gpg must be configured correctly. If it is not it a) can silently ignore
problems during signing b) can hang forever when e.g. gpg password store is
not accessible.
You may also specify per-tag environment variables for mock to use.
For example, to set the CC environment variable to clang, you could