summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/defaults.cfg5
-rw-r--r--mock.py6
2 files changed, 9 insertions, 2 deletions
diff --git a/etc/defaults.cfg b/etc/defaults.cfg
index 9af8095..cce1648 100644
--- a/etc/defaults.cfg
+++ b/etc/defaults.cfg
@@ -27,3 +27,8 @@
#config_opts['cache_topdir'] = "root-cache"
#config_opts['max_cache_age_days'] = 15
+## to add new rpmmacros, you need to follow special syntax or mock breaks:
+#config_opts['macros'] = config_opts['macros'] + """
+#%%_my_special_rpm_macro value
+#"""
+
diff --git a/mock.py b/mock.py
index fb411f8..771fc5b 100644
--- a/mock.py
+++ b/mock.py
@@ -241,7 +241,7 @@ class Root:
if cache_exists:
cache_mtime = os.stat(self.cache_file)[stat.ST_MTIME]
cache_age_days = (time.time() - cache_mtime) / (60 * 60 * 24)
- if cache_age_days > self.config['max_cache_age_days']:
+ if self.config['max_cache_age_days'] and cache_age_days > self.config['max_cache_age_days']:
self.config["rebuild_cache"] = True
if cache_exists and not self.config['rebuild_cache']:
@@ -250,7 +250,9 @@ class Root:
cmd = 'update'
else:
cmd = '%s' % self.config['chroot_setup_cmd']
- create_cache = 1
+ # never rebuild cache unless it was a clean build.
+ if self.config['clean']:
+ create_cache = 1
else:
if self.config['clean']:
cmd = '%s' % self.config['chroot_setup_cmd']