Provide generic config defaults. * Support a generic /etc/mock/defaults.cfg config file. The values defined in this file are overwritten by any definitions in the specific /etc/mock/CHROOT.cfg files. This part just introduces mock-0.4/etc/defaults.cfg and adds the last chunk in the patch to mock-0.4/mock.py. This patch was written in 2006 for bawue.net by Hans Ulrich Niedermann in 2006 after an idea by Andreas Thienemann. Testing and final clean-up was one by Andreas Thienemann. The source code this patch is based on has been downloaded from http://fedoraproject.org/projects/mock/releases/mock-0.4.tar.gz etc/defaults.cfg | 8 ++++++++ mock.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff -uNr mock-20060513.orig/etc/defaults.cfg mock-20060513/etc/defaults.cfg --- mock-20060513.orig/etc/defaults.cfg 1970-01-01 01:00:00.000000000 +0100 +++ mock-20060513/etc/defaults.cfg 2006-05-13 16:46:19.480038297 +0200 @@ -0,0 +1,8 @@ +# mock defaults +# +# Define default values here. +# These values are overwritten in the /etc/mock/CHROOT.cfg files. +# +# Example: +# +# config_opts['foo'] = bar diff -uNr mock-20060513.orig/mock.py mock-20060513/mock.py --- mock-20060513.orig/mock.py 2006-05-13 16:38:46.487358000 +0200 +++ mock-20060513/mock.py 2006-05-13 16:47:52.874952632 +0200 @@ -735,6 +735,14 @@ if options.configdir: config_path = options.configdir + # Read in the default values which can be overwritten + # with the more specific config being loaded below. + cfg = os.path.join(config_path, 'defaults.cfg') + if os.path.exists(cfg): + execfile(cfg) + else: + pass # not finding the defaults.cfg file is no error + # read in the config file by chroot name if options.chroot.endswith('.cfg'): cfg = '%s/%s' % (config_path, options.chroot)