Skip to content

Commit

Permalink
use jinja expansions for macro rpms
Browse files Browse the repository at this point in the history
  • Loading branch information
xsuchy committed Oct 16, 2019
1 parent 712266b commit d44ec01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mock/etc/mock/site-defaults.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"'

#############################################################################
#
Expand Down
5 changes: 3 additions & 2 deletions mock/py/mockbuild/plugins/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion mock/py/mockbuild/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down

0 comments on commit d44ec01

Please sign in to comment.