aboutsummaryrefslogtreecommitdiff
path: root/slave
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-07-03 13:36:16 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-07-03 13:36:16 +0530
commitb72c77c897db47c9c0b56d561e2f015fe8729e1b (patch)
treed9bd85f19fc338a4b84156421ce0229384c9779b /slave
parent- Implement a jobuild processor: autotua.jobuild.Processor() (diff)
downloadautotua-b72c77c897db47c9c0b56d561e2f015fe8729e1b.tar.gz
autotua-b72c77c897db47c9c0b56d561e2f015fe8729e1b.tar.bz2
autotua-b72c77c897db47c9c0b56d561e2f015fe8729e1b.zip
- Make PORTDIR and DISTDIR chroot bind mounting optional
default will be to fetch portage snapshot
Diffstat (limited to 'slave')
-rw-r--r--slave/autotua/chroot/__init__.py9
-rw-r--r--slave/autotua/const.py5
2 files changed, 11 insertions, 3 deletions
diff --git a/slave/autotua/chroot/__init__.py b/slave/autotua/chroot/__init__.py
index e4bc4f5..915d803 100644
--- a/slave/autotua/chroot/__init__.py
+++ b/slave/autotua/chroot/__init__.py
@@ -104,7 +104,14 @@ class WorkChroot(object):
for dir in ['dev', 'sys']:
result = subprocess.check_call('mount -o bind "%s" "%s"' % (osp.join('/', dir), osp.join(chrootdir, dir)), shell=True)
result = subprocess.check_call('mount -t proc proc "%s"' % osp.join(chrootdir, 'proc'), shell=True)
- result = subprocess.check_call('mount -o bind "%s" "%s"' % (const.PORTAGE_DIR, osp.join(chrootdir, 'usr', 'portage')), shell=True)
+ if const.PORTAGE_DIR:
+ if not osp.isdir(const.PORTAGE_DIR):
+ print "\"%s\" is not a directory, cannot mount" % const.PORTAGE_DIR
+ result = subprocess.check_call('mount -o bind "%s" "%s"' % (const.PORTAGE_DIR, osp.join(chrootdir, 'usr', 'portage')), shell=True)
+ if const.DISTFILES_DIR:
+ if not osp.isdir(const.DISTFILES_DIR):
+ print "\"%s\" is not a directory, cannot mount" % const.DISTFILES_DIR
+ result = subprocess.check_call('mount -o bind "%s" "%s"' % (const.DISTFILES_DIR, osp.join(chrootdir, 'usr', 'portage', 'distfiles')), shell=True)
def setup(self):
"""
diff --git a/slave/autotua/const.py b/slave/autotua/const.py
index abb6e2b..2946134 100644
--- a/slave/autotua/const.py
+++ b/slave/autotua/const.py
@@ -34,8 +34,9 @@ STAGE_FILENAME = '%(stage)s-%(arch)s-%(release)s.tar.bz2'
JOBTAGE_URI = 'git://git.overlays.gentoo.org/proj/jobtage.git'
JOBTAGE_DIR = '/var/tmp/autotua/jobtage'
-# Usually exists here (optional bind mounting)
-PORTAGE_DIR = '/usr/portage'
+# Bind mounted inside the chroots for use if defined
+PORTAGE_DIR = ''
+DISTFILES_DIR = ''
# Let's define a couple of jobs for now.
# We'll get them from the server later :P