Skip to content

Commit d44ec01

Browse files
committed
use jinja expansions for macro rpms
1 parent 712266b commit d44ec01

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

mock/etc/mock/site-defaults.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@
304304
# config_opts['plugin_conf']['sign_enable'] = False
305305
# config_opts['plugin_conf']['sign_opts'] = {}
306306
# config_opts['plugin_conf']['sign_opts']['cmd'] = 'rpmsign'
307-
# The options to pass to the signing command. %(rpms)s will be expanded to
307+
# The options to pass to the signing command. {{rpms}} will be expanded to
308308
# the rpms in the results folder.
309-
# config_opts['plugin_conf']['sign_opts']['opts'] = '--addsign %(rpms)s -D "%%_gpg_name your_name" -D "%%_gpg_path /home/your_name/.gnupg"'
309+
# config_opts['plugin_conf']['sign_opts']['opts'] = '--addsign {{rpms}} -D "%%_gpg_name your_name" -D "%%_gpg_path /home/your_name/.gnupg"'
310310

311311
#############################################################################
312312
#

mock/py/mockbuild/plugins/sign.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ def sign_results(self):
3636
rpms = [os.path.join(self.buildroot.resultdir, rpm) for rpm in self.buildroot.final_rpm_list]
3737
if rpms:
3838
getLog().info("Signing %s", ', '.join(rpms))
39-
opts = self.conf['opts'] % {'rpms': ' '.join(rpms), 'resultdir': self.buildroot.resultdir}
40-
cmd = "{0} {1}".format(self.conf['cmd'], opts)
39+
self.conf['rpms'] = ' '.join(rpms)
40+
cmd = "{0} {1}".format(self.conf['cmd'], self.conf['opts'])
41+
del self.conf['rpms']
4142
getLog().info("Executing %s", cmd)
4243
with self.buildroot.uid_manager:
4344
subprocess.call(cmd, shell=True, env=os.environ)

mock/py/mockbuild/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir):
10471047
'sign_enable': False,
10481048
'sign_opts': {
10491049
'cmd': 'rpmsign',
1050-
'opts': '--addsign %(rpms)s',
1050+
'opts': '--addsign {{rpms}}',
10511051
},
10521052
'hw_info_enable': True,
10531053
'hw_info_opts': {

0 commit comments

Comments
 (0)