Red Hat Bugzilla – Bug 277281
Comments on configuring .rpmmacros in mock config are incorrect (?)
Last modified: 2013-01-09 23:24:55 EST
It seem that the comments in /etc/mock/defaults.cfg for configuring .rpmmacros
are not quite correct. For mock-0.7.6 the comments read:
## to add new rpmmacros, you need to follow special syntax or mock breaks:
#config_opts['macros'] = config_opts['macros'] + """
I set some values this way and the resulting .rpmmacros in the chroot ended up
having the %% included. I changed the settings to remove one of the percent
signs and rebuilt the chroot cache, and all was well.
Is the syntax listed in the comments only needed if/when you're doing text
replacements (so python doesn't balk at bogus % modifiers)? Or did I do
something silly and not notice it?
Fixed in the great mock rewrite. I suspect we had some very odd character
substitution going on back then which got straightened out in the redesign.
The config options is now in /etc/mock/site-defaults.cfg. You specifiy the macro
name as a dictionary key with a value and mock defines the .rpmmacros file for
you, so you don't have to deal with '%' substitution.