aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2016-02-18 09:17:54 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-21 09:32:41 +0000
commit4c5c40df3c521913aa841d18c3b115adb66a2ef5 (patch)
treeb8d8f7a635846323c3d80141f6b0a1df9e3b340b /scripts
parent02201802a19250327f2a9aa83fd98f8588f2b5b9 (diff)
downloadopenembedded-core-contrib-4c5c40df3c521913aa841d18c3b115adb66a2ef5.tar.gz
devtool: Don't recursively look for .devtoolbase in --basepath
If the user specifies --basepath on the commandline, only the directory specified should be searched for .devtoolbase. Otherwise when --basepath is a child of the sdk directory, .devtoolbase will always be found and devtool will only show options meant to be used within an sdk. (From OE-Core rev: 3bb07c61220b89384a76c745e33be37aad5095c0) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/devtool28
1 files changed, 16 insertions, 12 deletions
diff --git a/scripts/devtool b/scripts/devtool
index 2d57da0bc1..23e9b50074 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -192,13 +192,6 @@ def main():
# Default basepath
basepath = os.path.dirname(os.path.abspath(__file__))
- pth = basepath
- while pth != '' and pth != os.sep:
- if os.path.exists(os.path.join(pth, '.devtoolbase')):
- context.fixed_setup = True
- basepath = pth
- break
- pth = os.path.dirname(pth)
parser = argparse_oe.ArgumentParser(description="OpenEmbedded development tool",
add_help=False,
@@ -224,11 +217,22 @@ def main():
if global_args.basepath:
# Override
basepath = global_args.basepath
- elif not context.fixed_setup:
- basepath = os.environ.get('BUILDDIR')
- if not basepath:
- logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
- sys.exit(1)
+ if os.path.exists(os.path.join(basepath, '.devtoolbase')):
+ context.fixed_setup = True
+ else:
+ pth = basepath
+ while pth != '' and pth != os.sep:
+ if os.path.exists(os.path.join(pth, '.devtoolbase')):
+ context.fixed_setup = True
+ basepath = pth
+ break
+ pth = os.path.dirname(pth)
+
+ if not context.fixed_setup:
+ basepath = os.environ.get('BUILDDIR')
+ if not basepath:
+ logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
+ sys.exit(1)
logger.debug('Using basepath %s' % basepath)