Support tag specific environment variables
This makes it possible to specify an environment variable for a tag that will be used during builds. e.g. koji edit-tag -x rpm.env.CC=clang
This commit is contained in:
parent
62ce45b104
commit
afc0efb122
3 changed files with 19 additions and 0 deletions
|
|
@ -293,10 +293,13 @@ class BuildRoot(object):
|
|||
if self.internal_dev_setup is not None:
|
||||
opts['internal_dev_setup'] = bool(self.internal_dev_setup)
|
||||
opts['tag_macros'] = {}
|
||||
opts['tag_envvars'] = {}
|
||||
for key in self.config['extra']:
|
||||
if key.startswith('rpm.macro.'):
|
||||
macro = '%' + key[10:]
|
||||
opts['tag_macros'][macro] = self.config['extra'][key]
|
||||
elif key.startswith('rpm.env.'):
|
||||
opts['tag_envvars'][key[8:]] = self.config['extra'][key]
|
||||
output = koji.genMockConfig(self.name, self.br_arch, managed=True, **opts)
|
||||
|
||||
# write config
|
||||
|
|
|
|||
|
|
@ -395,6 +395,15 @@ environment follows:
|
|||
`--old-chroot` option is appended to any mock call. If it is not set,
|
||||
mock's default behavior is used.
|
||||
|
||||
You may also specify per-tag environment variables for mock to use.
|
||||
For example, to set the CC environment variable to clang, you could
|
||||
do:
|
||||
|
||||
::
|
||||
|
||||
koji edit-tag dnf-fedora-tag -x rpm.env.CC=clang
|
||||
|
||||
|
||||
Using Koji to control tasks
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
|||
|
|
@ -1697,6 +1697,13 @@ name=build
|
|||
value = macros[key]
|
||||
parts.append("config_opts['macros'][%r] = %r\n" % (key, value))
|
||||
parts.append("\n")
|
||||
envvars = opts.get('tag_envvars', {})
|
||||
for key in sorted(envvars):
|
||||
value = envvars[key]
|
||||
parts.append("config_opts['environment'][%r] = %r\n" % (key, value))
|
||||
if len(envvars):
|
||||
parts.append("\n")
|
||||
|
||||
for key in sorted(files):
|
||||
value = files[key]
|
||||
parts.append("config_opts['files'][%r] = %r\n" % (key, value))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue