diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-07-15 12:35:43 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-23 20:06:57 +0100 |
commit | 6cfb76fa8bd1c192e6a0524b7670e2172e5d8e26 (patch) | |
tree | 8210bd00ecda985d8498c3d4ebc41bf38fb65540 /bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | |
parent | 5ba68f32a86a20b3f3544903fea2a24f2e59afbf (diff) | |
download | poky-6cfb76fa8bd1c192e6a0524b7670e2172e5d8e26.tar.gz |
bitbake: toaster: add fields for sourcedir and builddir paths
We add explicit absolute paths for a directory where
the layer sources will be checked out (sourcedir) and
where the build activities will take place.
Adding minimal checking when starting the application in
order to make sure that BuildEnvironment (BE) settings are
usable. This check is ran by the toaster script at startup.
Modify the localhost bbcontroller to use the BE settings
instead of trying to self-configure on checked out sources.
(Bitbake rev: d17500d3f73fdeeef5f11fb3773a65e927be3f02)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py new file mode 100644 index 0000000000..0e8260e6c9 --- /dev/null +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | |||
@@ -0,0 +1,33 @@ | |||
1 | from django.core.management.base import NoArgsCommand, CommandError | ||
2 | from django.db import transaction | ||
3 | from orm.models import Build | ||
4 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException | ||
5 | from bldcontrol.models import BuildRequest, BuildEnvironment | ||
6 | import os | ||
7 | |||
8 | class Command(NoArgsCommand): | ||
9 | args = "" | ||
10 | help = "Verifies thid %dthe configured settings are valid and usable, or prompts the user to fix the settings." | ||
11 | |||
12 | def handle(self, **options): | ||
13 | # we make sure we have builddir and sourcedir for all defined build envionments | ||
14 | for be in BuildEnvironment.objects.all(): | ||
15 | def _verify_be(): | ||
16 | is_changed = False | ||
17 | print("Verifying the Build Environment type %s id %d." % (be.get_betype_display(), be.pk)) | ||
18 | if len(be.sourcedir) == 0: | ||
19 | be.sourcedir = raw_input(" -- sourcedir may not be empty:") | ||
20 | is_changed = True | ||
21 | if not be.sourcedir.startswith("/"): | ||
22 | be.sourcedir = raw_input(" -- sourcedir must be an absolute path:") | ||
23 | is_changed = True | ||
24 | if len(be.builddir) == 0: | ||
25 | be.builddir = raw_input(" -- builddir may not be empty:") | ||
26 | is_changed = True | ||
27 | if not be.builddir.startswith("/"): | ||
28 | be.builddir = raw_input(" -- builddir must be an absolute path:") | ||
29 | is_changed = True | ||
30 | return is_changed | ||
31 | |||
32 | while (_verify_be()): | ||
33 | pass | ||