aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-02-09 16:42:29 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-19 06:28:47 -0800
commit157d9d92a026db96eb7388a719aa800d2f5bbe2d (patch)
treeefa6a75a42de9a47aecbc13ffbccd93ca0a9ede1
parentb14e61d1bd17d2976cc25fc78ccaad1c0659dd50 (diff)
downloadopenembedded-core-contrib-157d9d92a026db96eb7388a719aa800d2f5bbe2d.tar.gz
bitbake: tinfoil: ensure PATH includes bitbake's bin directory
The runqueue expects to be able to run 'bitbake-worker' from PATH, but for example in the OE extensible SDK, tinfoil is used within devtool where this isn't the case (we're not exposing bitbake to the user, thus bitbake's bin directory isn't in PATH). This fixes devtool modify usage within the extensible SDK which has apparently been broken since the tinfoil2 changes went in. Fixes [YOCTO #11034]. (Bitbake rev: 52d87e4a58a52174e8e0b6297abaac8fd93ffcc3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/tinfoil.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 96275fde7f..940f9ab0d5 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -211,6 +211,19 @@ class Tinfoil:
self.ui_module = ui_module
+ # Ensure the path to bitbake's bin directory is in PATH so that things like
+ # bitbake-worker can be run (usually this is the case, but it doesn't have to be)
+ path = os.getenv('PATH').split(':')
+ bitbakebinpath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'bin'))
+ for entry in path:
+ if entry.endswith(os.sep):
+ entry = entry[:-1]
+ if os.path.abspath(entry) == bitbakebinpath:
+ break
+ else:
+ path.insert(0, bitbakebinpath)
+ os.environ['PATH'] = ':'.join(path)
+
if self.server_connection:
_server_connections.append(self.server_connection)
if config_only: