From f4e23e3a5cda4b324640c256b26717b983e51b63 Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Mon, 23 Jul 2007 11:00:26 -0500 Subject: update default config file with suggestion on how to set config_opts['macros'] --- etc/defaults.cfg | 5 +++++ 1 file changed, 5 insertions(+) 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 +#""" + -- cgit From 6f3c7f0c021ec45659dcdd5226962cc019cbcd09 Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Wed, 1 Aug 2007 23:45:22 -0500 Subject: BZ 250425. Set rebuild_cache=0 to disable rebuilding of cache. --- mock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mock.py b/mock.py index de3adb9..8e9e7c1 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']: -- cgit From a2fbe5b9aa9df9e55393b82b7efdba91acc38a8e Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Thu, 2 Aug 2007 00:13:04 -0500 Subject: BZ 250425. prevent building/rebuilding of cache file unless the build was a clean build. This should prevent the cache from getting polluted. --- mock.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mock.py b/mock.py index 8e9e7c1..36a404e 100644 --- a/mock.py +++ b/mock.py @@ -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'] -- cgit