summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskvidal <skvidal>2006-05-14 04:48:11 +0000
committerskvidal <skvidal>2006-05-14 04:48:11 +0000
commit2a84506fa40715b94207379e3b3caf030b010c69 (patch)
treecf5d007569bf73f559aae5cfe824e5db081e0e33
parente93b34bd0e792798c96909bd1ea90010fc165c43 (diff)
downloadmock-2a84506fa40715b94207379e3b3caf030b010c69.tar.gz
mock-2a84506fa40715b94207379e3b3caf030b010c69.tar.xz
mock-2a84506fa40715b94207379e3b3caf030b010c69.zip
check in global defaults patch from Andreas Thienemann
-rw-r--r--etc/defaults.cfg8
-rw-r--r--mock.py8
2 files changed, 16 insertions, 0 deletions
diff --git a/etc/defaults.cfg b/etc/defaults.cfg
new file mode 100644
index 0000000..21e7d4a
--- /dev/null
+++ b/etc/defaults.cfg
@@ -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 --git a/mock.py b/mock.py
index a3e075d..8d28939 100644
--- a/mock.py
+++ b/mock.py
@@ -735,6 +735,14 @@ def main():
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)