summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Howarth <paul@city-fan.org>2010-08-11 11:54:01 +0100
committerClark Williams <williams@redhat.com>2010-08-14 09:18:17 -0500
commitd08cbd19aa4393fcc8d3f0ee6f6040013a967499 (patch)
tree866acdefb90d029a1b251c704ee766d74102eb02
parentc6e28ae633fa4470a852f8f137d88b191f963dcb (diff)
downloadmock-d08cbd19aa4393fcc8d3f0ee6f6040013a967499.tar.gz
mock-d08cbd19aa4393fcc8d3f0ee6f6040013a967499.tar.xz
mock-d08cbd19aa4393fcc8d3f0ee6f6040013a967499.zip
Update packages after unpacking root cache
Fix problem introduced in commit 3bc5fb958deb809fc04d6a74ce6688e093f5831a where the buildroot is no longer updated after unpacking the root cache. http://bugzilla.redhat.com/557526 Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r--py/mock/backend.py3
-rw-r--r--py/mock/plugins/root_cache.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/py/mock/backend.py b/py/mock/backend.py
index bd9547d..c7d0ca9 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -34,6 +34,7 @@ class Root(object):
self._state = 'unstarted'
self.uidManager = uidManager
self._hooks = {}
+ self.chrootWasCached = False
self.chrootWasCleaned = False
self.preExistingDeps = ""
self.logging_initialized = False
@@ -311,6 +312,8 @@ class Root(object):
self._mountall()
if self.chrootWasCleaned:
self._yum(self.chroot_setup_cmd, returnOutput=1)
+ if self.chrootWasCached:
+ self._yum('update', returnOutput=1)
# create user
self._makeBuildUser()
diff --git a/py/mock/plugins/root_cache.py b/py/mock/plugins/root_cache.py
index 60b8138..007627c 100644
--- a/py/mock/plugins/root_cache.py
+++ b/py/mock/plugins/root_cache.py
@@ -86,7 +86,7 @@ class RootCache(object):
except OSError:
pass
- # optimization: dont unpack root cache if chroot was not cleaned
+ # optimization: don't unpack root cache if chroot was not cleaned
if os.path.exists(self.rootCacheFile) and self.rootObj.chrootWasCleaned:
self.state("unpacking root cache")
self._rootCacheLock()
@@ -95,8 +95,8 @@ class RootCache(object):
shell=False
)
self._rootCacheUnlock()
- self.chroot_setup_cmd = "update"
self.rootObj.chrootWasCleaned = False
+ self.rootObj.chrootWasCached = True
decorate(traceLog())
def _rootCachePostInitHook(self):