]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: force use of bash when running build within extensible SDK
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 20 Apr 2015 16:47:05 +0000 (17:47 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 24 Apr 2015 10:05:56 +0000 (11:05 +0100)
Ubuntu's default dash shell causes oe-init-build-env to behave a bit
differently - (a) it can't pick up the OE root directory and (b) it
can't see any build directory specified as a command-line argument
(since dash doesn't pass through any arguments specified to sourced
scripts). We could work around these but doing so requires some internal
knowledge of the script; a much simpler fix is just to force running the
command under bash since it's expected to be installed on every distro.

Thanks to Chen Qi <Qi.Chen@windriver.com> for this fix.

Fixes [YOCTO #7614].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/__init__.py

index 3f8158e24a5540aefcfc5f09089eb894d48d5701..78ae0aabc8df5bc58e17520fcd0ce49ebf5bd705 100644 (file)
@@ -30,6 +30,11 @@ def exec_build_env_command(init_path, builddir, cmd, watch=False, **options):
     if not 'cwd' in options:
         options["cwd"] = builddir
     if init_path:
+        # As the OE init script makes use of BASH_SOURCE to determine OEROOT,
+        # and can't determine it when running under dash, we need to set
+        # the executable to bash to correctly set things up
+        if not 'executable' in options:
+            options['executable'] = 'bash'
         logger.debug('Executing command: "%s" using init path %s' % (cmd, init_path))
         init_prefix = '. %s %s > /dev/null && ' % (init_path, builddir)
     else: