Bug 358151 - mock 0.8.x and .rpmmacros
Summary: mock 0.8.x and .rpmmacros
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 7
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-30 13:26 UTC by Remi Collet
Modified: 2013-01-10 01:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-10-30 14:16:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Remi Collet 2007-10-30 13:26:35 UTC
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
_buildDirSetup
    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)
            rpmmacros.close()

Does an official solution exists for this need ?

Regards

Comment 1 Michael E Brown 2007-10-30 14:16:15 UTC
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.