diff options
author | Clark Williams <williams@redhat.com> | 2008-08-29 14:55:34 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2008-08-29 14:55:34 -0500 |
commit | d94d494073ff9bbee3f44a1d166af31e87c0ac8c (patch) | |
tree | b0d9d86b869275f445f848185896766e4dff82a7 /py/mock/plugins | |
parent | 349aaca37116efef59fd559eba1e574e990a8c1b (diff) | |
download | mock-d94d494073ff9bbee3f44a1d166af31e87c0ac8c.tar.gz mock-d94d494073ff9bbee3f44a1d166af31e87c0ac8c.tar.xz mock-d94d494073ff9bbee3f44a1d166af31e87c0ac8c.zip |
workaround new rpm issues by deleting rpmdb temp files after unpacking root cache
Diffstat (limited to 'py/mock/plugins')
-rw-r--r-- | py/mock/plugins/root_cache.py | 20 |
1 files 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() - |