From a75a61823cdf4574c1238e8343590b30e6ef15f4 Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Sun, 21 Oct 2007 16:03:57 -0500 Subject: small optimizations to not unpack root cache for --no-clean. fix accounting typo so we dont re-create root cache for non-clean builds. --- src/py-libs/plugins/root_cache.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/py-libs/plugins/root_cache.py') diff --git a/src/py-libs/plugins/root_cache.py b/src/py-libs/plugins/root_cache.py index 9797531..0b33725 100644 --- a/src/py-libs/plugins/root_cache.py +++ b/src/py-libs/plugins/root_cache.py @@ -73,18 +73,19 @@ class RootCache(object): except OSError: pass - if os.path.exists(self.rootCacheFile): + # optimization: dont unpack root cache if chroot was not cleaned + if os.path.exists(self.rootCacheFile) and self.rootObj.chrootWasCleaned: self.state("unpacking cache") self._rootCacheLock() mock.util.do("tar xzf %s -C %s" % (self.rootCacheFile, self.rootdir)) self._rootCacheUnlock() self.chroot_setup_cmd = "update" - self.chrootWasCleaned = False + self.rootObj.chrootWasCleaned = False @traceLog(moduleLog) def _rootCachePostInitHook(self): # never rebuild cache unless it was a clean build. - if self.chrootWasCleaned: + if self.rootObj.chrootWasCleaned: self.state("creating cache") self._rootCacheLock(shared=0) mock.util.do("tar czf %s -C %s ." % (self.rootCacheFile, self.rootdir)) -- cgit