From d94d494073ff9bbee3f44a1d166af31e87c0ac8c Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Fri, 29 Aug 2008 14:55:34 -0500 Subject: workaround new rpm issues by deleting rpmdb temp files after unpacking root cache --- py/mock/plugins/root_cache.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/py/mock/plugins/root_cache.py b/py/mock/plugins/root_cache.py index 5382912..b9fe677 100644 --- a/py/mock/plugins/root_cache.py +++ b/py/mock/plugins/root_cache.py @@ -93,13 +93,19 @@ class RootCache(object): decorate(traceLog()) def _rootCachePostInitHook(self): - # never rebuild cache unless it was a clean build. - if self.rootObj.chrootWasCleaned: - self.state("creating cache") + try: self._rootCacheLock(shared=0) + # nuke any rpmdb tmp files mock.util.do( - ["tar", "czf", self.rootCacheFile, "-C", self.rootObj.makeChrootPath(), "."], - shell=False - ) + ['rm', '-f', self.rootObj.makeChrootPath('var/lib/rpm/__db*')]) + + # never rebuild cache unless it was a clean build. + if self.rootObj.chrootWasCleaned: + self.state("creating cache") + mock.util.do( + ["tar", "czf", self.rootCacheFile, + "-C", self.rootObj.makeChrootPath(), "."], + shell=False + ) + finally: self._rootCacheUnlock() - -- cgit