diff options
Diffstat (limited to 'slave/autotua/chroot/__init__.py')
-rw-r--r-- | slave/autotua/chroot/__init__.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/slave/autotua/chroot/__init__.py b/slave/autotua/chroot/__init__.py index cdc02c2..4ed0cec 100644 --- a/slave/autotua/chroot/__init__.py +++ b/slave/autotua/chroot/__init__.py @@ -114,6 +114,7 @@ class WorkChroot(object): def _setup_mounts(self): for dir in ['/dev', '/sys', '/proc']: self._bind(dir, dir) + # FIXME: else: Fetch portage tarball and use. if const.PORTAGE_DIR: if not osp.isdir(const.PORTAGE_DIR): print "\"%s\" is not a directory, cannot mount" % const.PORTAGE_DIR @@ -122,8 +123,8 @@ class WorkChroot(object): if not osp.isdir(const.DISTFILES_DIR): print "\"%s\" is not a directory, cannot mount" % const.DISTFILES_DIR self._bind(const.DISTFILES_DIR, '/usr/portage/distfiles', ro=False) - self._bind(const.AUTOTUA_DIR+'/bin', '/tmp/autotua/bin') - self._bind(self.jobdir+'/jobtage', '/tmp/autotua/jobtage') + self._bind(const.AUTOTUA_DIR+'/bin', const.CHAUTOTUA_DIR+'/bin') + self._bind(self.jobdir+'/jobtage', const.CHAUTOTUA_DIR+'/jobtage') def setup(self): """ @@ -139,7 +140,7 @@ class WorkChroot(object): print "Preparing Work Chroot..." sync.Syncer(uri=self.pristine.dir+"/", destdir=self.chrootdir, scheme='rsync-nc').sync() for dir in ['bin', 'jobfiles', 'jobtage', 'src']: - os.makedirs('%s/tmp/autotua/%s' % (self.chrootdir, dir)) + os.makedirs('%s/%s/%s' % (self.chrootdir, const.CHAUTOTUA_DIR, dir)) self._setup_mounts() print "Work Chroot ready." @@ -148,8 +149,8 @@ class WorkChroot(object): Cleanup when done. """ self._clean_mounts() - if osp.isdir('%s/tmp/autotua' % self.chrootdir): - if not osp.isdir('%s/tmp/autotua-old' % self.chrootdir): - os.makedirs('%s/tmp/autotua-old' % self.chrootdir) - shutil.move('%s/tmp/autotua' % (self.chrootdir), - '%s/tmp/autotua-old/autotua-%s' % (self.chrootdir, strftime('%Y%m%d%H%M%S'))) + if osp.isdir(self.chrootdir+const.CHAUTOTUA_DIR): + if not osp.isdir(self.chrootdir+const.CHAUTOTUA_DIR+'-old'): + os.makedirs(self.chrootdir+const.CHAUTOTUA_DIR+'-old') + shutil.move(self.chrootdir+const.CHAUTOTUA_DIR, + self.chrootdir+const.CHAUTOTUA_DIR+'-old/autotua-'+strftime('%Y%m%d%H%M%S')) |