Skip to content
Permalink
Browse files

use jinja expansions for macro rpms

  • Loading branch information
xsuchy committed Oct 16, 2019
1 parent 712266b commit d44ec018b59822c8ba6dcffb0002148b57a69457
Showing with 6 additions and 5 deletions.
  1. +2 −2 mock/etc/mock/site-defaults.cfg
  2. +3 −2 mock/py/mockbuild/plugins/sign.py
  3. +1 −1 mock/py/mockbuild/util.py
@@ -304,9 +304,9 @@
# config_opts['plugin_conf']['sign_enable'] = False
# config_opts['plugin_conf']['sign_opts'] = {}
# config_opts['plugin_conf']['sign_opts']['cmd'] = 'rpmsign'
# The options to pass to the signing command. %(rpms)s will be expanded to
# The options to pass to the signing command. {{rpms}} will be expanded to
# the rpms in the results folder.
# config_opts['plugin_conf']['sign_opts']['opts'] = '--addsign %(rpms)s -D "%%_gpg_name your_name" -D "%%_gpg_path /home/your_name/.gnupg"'
# config_opts['plugin_conf']['sign_opts']['opts'] = '--addsign {{rpms}} -D "%%_gpg_name your_name" -D "%%_gpg_path /home/your_name/.gnupg"'

#############################################################################
#
@@ -36,8 +36,9 @@ def sign_results(self):
rpms = [os.path.join(self.buildroot.resultdir, rpm) for rpm in self.buildroot.final_rpm_list]
if rpms:
getLog().info("Signing %s", ', '.join(rpms))
opts = self.conf['opts'] % {'rpms': ' '.join(rpms), 'resultdir': self.buildroot.resultdir}
cmd = "{0} {1}".format(self.conf['cmd'], opts)
self.conf['rpms'] = ' '.join(rpms)
cmd = "{0} {1}".format(self.conf['cmd'], self.conf['opts'])
del self.conf['rpms']
getLog().info("Executing %s", cmd)
with self.buildroot.uid_manager:
subprocess.call(cmd, shell=True, env=os.environ)
@@ -1047,7 +1047,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir):
'sign_enable': False,
'sign_opts': {
'cmd': 'rpmsign',
'opts': '--addsign %(rpms)s',
'opts': '--addsign {{rpms}}',
},
'hw_info_enable': True,
'hw_info_opts': {

0 comments on commit d44ec01

Please sign in to comment.
You can’t perform that action at this time.