Description of problem: mock doesn't support custom *.cfgs. Version-Release number of selected component (if applicable): How reproducible: Deterministic. Steps to Reproduce: 1. mkdir foo 2. cp /etc/mock/fedora-7-i386.cfg foo/fedora-7-i386-test.cfg 3. mock --configdir=.../foo -r fedora-7-i386-test init Actual results: # mock --configdir=.../foo -r fedora-7-i386-test init INFO: mock suid wrapper version 0.8.4 ERROR:root:No section: 'formatters' Traceback (most recent call last): File "/usr/libexec/mock.py", line 333, in <module> main(retParams) File "/usr/libexec/mock.py", line 239, in main logging.config.fileConfig(os.path.join(config_path, config_opts["log_config_file"])) File "/usr/lib/python2.5/logging/config.py", line 76, in fileConfig formatters = _create_formatters(cp) File "/usr/lib/python2.5/logging/config.py", line 107, in _create_formatters flist = cp.get("formatters", "keys") File "/usr/lib/python2.5/ConfigParser.py", line 511, in get raise NoSectionError(section) NoSectionError: No section: 'formatters' Expected results: function. This bug renders mock as unusable as build-infrastructure for 3rd party repos.
Oops, forgot the version: mock-0.8.4-2.fc7
You need a 'logging.ini' in the --configdir specified. Just copy the default one from /etc/mock. Mock 0.8.5 has a better error message for this and will be released within the next couple weeks.
(In reply to comment #2) > You need a 'logging.ini' in the --configdir specified. Just copy the default one > from /etc/mock. Mock 0.8.5 has a better error message for this and will be > released within the next couple weeks. OK, partial success. But why doesn't yum pick up logging.ini from the default location (i.e. treat --configdir as a search-path? This way, mock-0.8.4 would have stayed backward compatible and would not have broken existing configurations. However, with logging.ini copied over to .../foo, my formerly functional configurations still fail: # mock --configdir=/users/rtems/mock/etc/mock -r fedora-7-i386-rtems4.9 init INFO: mock suid wrapper version 0.8.4 ERROR: unsupported operand type(s) for +=: 'dict' and 'str' Traceback (most recent call last): File "/usr/libexec/mock.py", line 333, in <module> main(retParams) File "/usr/libexec/mock.py", line 249, in main execfile(cfg) File "/users/rtems/mock/etc/mock/fedora-7-i386-rtems4.9.cfg", line 7, in <module> config_opts['macros'] += '%vendor RTEMS Project http://www.rtems.org' TypeError: unsupported operand type(s) for +=: 'dict' and 'str' Background: I have config_opts['macros'] += '%vendor RTEMS Project http://www.rtems.org' In my customized *.cfgs
look in defaults.cfg for the new format for adding rpm macros. I believe that the release notes covered the changes to configuration option handling for this specific option. config_opts['macros']['%your_macro_name'] = 'your macro value' There were a small handful of configuration options that changed for mock 0.8, but I tried to keep as much compatibility as possible. Most of the instances I am aware of were covered in the release announcement and release notes. I have 0.8.5 almost ready which fixes some small documentation problems and a few other small issues. Look in defaults.cfg for docs for all the currently available config options.