Bug 358151 - mock 0.8.x and .rpmmacros
mock 0.8.x and .rpmmacros
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-10-30 09:26 EDT by Remi Collet
Modified: 2013-01-09 20:43 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-10-30 10:16:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Remi Collet 2007-10-30 09:26:35 EDT
Version : mock-0.8.4-2.fc7

Until version 0.7.x we can add directives to .rpmmacros using, in target.cfg

For exemple : 
config_opts['macros'] = """
%_smp_mflags  	-j3

%vendor         Remi Collet

Since the new 0.8.x this is not possible, this result in :

  File "/usr/lib/python2.5/site-packages/mock/backend.py", line 502, in
    self.macros['%_rpmlock_path'] = "%s/var/lib/rpm/__db.000" % self.basedir
TypeError: 'str' object does not support item assignment

I use a "poor" workaround

        self.macros = config['macros']
+       self.macros_conf_content = config['macrosx']
        self.more_buildreqs = config['more_buildreqs']

and : 

            rpmmacros = open(macrofile_out, 'w+')
            for key, value in self.macros.items():
                rpmmacros.write( "%s %s\n" % (key, value) )
+           rpmmacros.write(self.macros_conf_content)

Does an official solution exists for this need ?

Comment 1 Michael E Brown 2007-10-30 10:16:15 EDT
from /etc/mock/defaults.cfg:

# config_opts['macros']['Add_your_macro_name_here'] = "add macro value here"

Note You need to log in before you can comment on or make changes to this bug.