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:
Tom Stellard 2020-03-05 14:15:51 -08:00 committed by Tomas Kopecek
parent 62ce45b104
commit afc0efb122
3 changed files with 19 additions and 0 deletions

View file

@ -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