summaryrefslogtreecommitdiffstats
path: root/py/mock/plugins
diff options
context:
space:
mode:
authorSeth Vidal <skvidal@fedoraproject.org>2010-05-09 10:31:33 +0300
committerVille Skyttä <ville.skytta@iki.fi>2010-05-09 10:58:11 +0300
commit426b2ae54daa2d5177fd3cc17e9aab0f1576578c (patch)
tree92c7db36613048412af4c8bd85d8363616a16ba5 /py/mock/plugins
parent256f250dce17e6240bda8ddbb6aac2bd2d12e30c (diff)
downloadmock-426b2ae54daa2d5177fd3cc17e9aab0f1576578c.tar.gz
mock-426b2ae54daa2d5177fd3cc17e9aab0f1576578c.tar.xz
mock-426b2ae54daa2d5177fd3cc17e9aab0f1576578c.zip
yum made/makes an rpmdb cache dir in $cachedir/installed for a while
things can go wrong in a specific mock case if this happened. So just nuke the installed dir and the files in it. Problem solved.
Diffstat (limited to 'py/mock/plugins')
-rw-r--r--py/mock/plugins/yum_cache.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/py/mock/plugins/yum_cache.py b/py/mock/plugins/yum_cache.py
index fb16bc7..e2a7aa3 100644
--- a/py/mock/plugins/yum_cache.py
+++ b/py/mock/plugins/yum_cache.py
@@ -7,6 +7,7 @@
import fcntl
import time
import os
+import glob
# our imports
from mock.trace_decorator import decorate, traceLog, getLog
@@ -88,5 +89,13 @@ class YumCache(object):
os.unlink(fullPath)
continue
+ # yum made an rpmdb cache dir in $cachedir/installed for a while;
+ # things can go wrong in a specific mock case if this happened.
+ # So - just nuke the dir and all that's in it.
+ if os.path.exists(self.yumSharedCachePath + '/installed'):
+ for fn in glob.glob(self.yumSharedCachePath + '/installed/*'):
+ os.unlink(fn)
+ os.rmdir(self.yumSharedCachePath + '/installed')
+
self._yumCachePostYumHook()