diff options
| author | Clark Williams <williams@redhat.com> | 2007-12-13 17:35:42 -0600 |
|---|---|---|
| committer | Clark Williams <williams@redhat.com> | 2007-12-13 17:35:42 -0600 |
| commit | 6b2d14f9afb39a955331f4a52a597b122f585166 (patch) | |
| tree | 42e0863a785ba46d8c38be540307d850c4375a57 /py/mock/plugins | |
| parent | 076a90491cfc27c895618d950c4de828489c189c (diff) | |
| download | mock-6b2d14f9afb39a955331f4a52a597b122f585166.tar.gz mock-6b2d14f9afb39a955331f4a52a597b122f585166.tar.xz mock-6b2d14f9afb39a955331f4a52a597b122f585166.zip | |
changed more uses of .rootdir to makeChrootPath(); updated man page for --copyin and --copyout; updated plugins to use makeChrootPath(); updated releasetests.sh so that daemon tests uses --copyin
Diffstat (limited to 'py/mock/plugins')
| -rw-r--r-- | py/mock/plugins/bind_mount.py | 6 | ||||
| -rw-r--r-- | py/mock/plugins/ccache.py | 7 | ||||
| -rw-r--r-- | py/mock/plugins/yum_cache.py | 7 |
3 files changed, 9 insertions, 11 deletions
diff --git a/py/mock/plugins/bind_mount.py b/py/mock/plugins/bind_mount.py index 60f0f8b..df5e215 100644 --- a/py/mock/plugins/bind_mount.py +++ b/py/mock/plugins/bind_mount.py @@ -29,10 +29,10 @@ class BindMount(object): rootObj.bindMountObj = self rootObj.addHook("preinit", self._bindMountPreInitHook) for srcdir, destdir in self.bind_opts['dirs']: - rootObj.umountCmds.append('umount -n %s/%s' % (rootObj.rootdir, destdir)) - rootObj.mountCmds.append('mount -n --bind %s %s/%s' % (srcdir, rootObj.rootdir, destdir)) + rootObj.umountCmds.append('umount -n %s' % rootObj.makeChrootPath(destdir)) + rootObj.mountCmds.append('mount -n --bind %s %s' % (srcdir, rootObj.makeChrootPath(destdir))) decorate(traceLog()) def _bindMountPreInitHook(self): for srcdir, destdir in self.bind_opts['dirs']: - mock.util.mkdirIfAbsent("%s/%s" % (self.rootObj.rootdir, destdir)) + mock.util.mkdirIfAbsent(self.rootObj.makeChrootPath(destdir)) diff --git a/py/mock/plugins/ccache.py b/py/mock/plugins/ccache.py index 7974b1f..77a9130 100644 --- a/py/mock/plugins/ccache.py +++ b/py/mock/plugins/ccache.py @@ -25,13 +25,12 @@ class CCache(object): self.rootObj = rootObj self.ccache_opts = conf self.ccachePath = self.ccache_opts['dir'] % self.ccache_opts - self.rootdir = rootObj.rootdir rootObj.ccacheObj = self rootObj.preExistingDeps = rootObj.preExistingDeps + " ccache " rootObj.addHook("prebuild", self._ccacheBuildHook) rootObj.addHook("preinit", self._ccachePreInitHook) - rootObj.umountCmds.append('umount -n %s/tmp/ccache' % rootObj.rootdir) - rootObj.mountCmds.append('mount -n --bind %s %s/tmp/ccache' % (self.ccachePath, rootObj.rootdir)) + rootObj.umountCmds.append('umount -n %s' % rootObj.makeChrootPath("/tmp/ccache")) + rootObj.mountCmds.append('mount -n --bind %s %s' % (self.ccachePath, rootObj.makeChrootPath("/tmp/ccache"))) # ============= # 'Private' API @@ -49,7 +48,7 @@ class CCache(object): # cache. decorate(traceLog()) def _ccachePreInitHook(self): - mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'tmp/ccache')) + mock.util.mkdirIfAbsent(self.rootObj.makeChrootPath('/tmp/ccache')) mock.util.mkdirIfAbsent(self.ccachePath) os.environ['PATH'] = "/tmp/ccache:%s" % (os.environ['PATH']) os.environ['CCACHE_DIR'] = "/tmp/ccache" diff --git a/py/mock/plugins/yum_cache.py b/py/mock/plugins/yum_cache.py index 5b371bb..bcdf465 100644 --- a/py/mock/plugins/yum_cache.py +++ b/py/mock/plugins/yum_cache.py @@ -30,14 +30,13 @@ class YumCache(object): self.yum_cache_opts = conf self.yumSharedCachePath = self.yum_cache_opts['dir'] % self.yum_cache_opts self.state = rootObj.state - self.rootdir = rootObj.rootdir self.online = rootObj.online rootObj.yum_cacheObj = self rootObj.addHook("preyum", self._yumCachePreYumHook) rootObj.addHook("postyum", self._yumCachePostYumHook) rootObj.addHook("preinit", self._yumCachePreInitHook) - rootObj.umountCmds.append('umount -n %s/var/cache/yum' % rootObj.rootdir) - rootObj.mountCmds.append('mount -n --bind %s %s/var/cache/yum' % (self.yumSharedCachePath, rootObj.rootdir)) + rootObj.umountCmds.append('umount -n %s' % rootObj.makeChrootPath('/var/cache/yum')) + rootObj.mountCmds.append('mount -n --bind %s %s' % (self.yumSharedCachePath, rootObj.makeChrootPath('/var/cache/yum'))) mock.util.mkdirIfAbsent(self.yumSharedCachePath) self.yumCacheLock = open(os.path.join(self.yumSharedCachePath, "yumcache.lock"), "a+") @@ -65,7 +64,7 @@ class YumCache(object): decorate(traceLog()) def _yumCachePreInitHook(self): getLog().info("enabled yum cache") - mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'var/cache/yum')) + mock.util.mkdirIfAbsent(self.rootObj.makeChrootPath('/var/cache/yum')) # lock so others dont accidentally use yum cache while we operate on it. self._yumCachePreYumHook() |
