diff options
author | Michael E Brown <mebrown@michaels-house.net> | 2007-10-21 16:03:57 -0500 |
---|---|---|
committer | Michael E Brown <mebrown@michaels-house.net> | 2007-10-21 16:03:57 -0500 |
commit | a75a61823cdf4574c1238e8343590b30e6ef15f4 (patch) | |
tree | cc08dcbc41dc10ae03158328c906dbf8a07e9819 | |
parent | b01eee7be9a9187c8f1fcc257e9c905bb972cab7 (diff) | |
download | mock-a75a61823cdf4574c1238e8343590b30e6ef15f4.tar.gz mock-a75a61823cdf4574c1238e8343590b30e6ef15f4.tar.xz mock-a75a61823cdf4574c1238e8343590b30e6ef15f4.zip |
small optimizations to not unpack root cache for --no-clean. fix accounting typo so we dont re-create root cache for non-clean builds.
-rw-r--r-- | src/py-libs/plugins/root_cache.py | 7 |
1 files changed, 4 insertions, 3 deletions
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)) |