diff options
| author | Randy Witt <randy.e.witt@linux.intel.com> | 2016-02-18 09:17:54 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-21 09:32:41 +0000 |
| commit | 4c5c40df3c521913aa841d18c3b115adb66a2ef5 (patch) | |
| tree | b8d8f7a635846323c3d80141f6b0a1df9e3b340b | |
| parent | 02201802a19250327f2a9aa83fd98f8588f2b5b9 (diff) | |
| download | poky-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>
| -rwxr-xr-x | scripts/devtool | 28 |
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(): | |||
| 192 | 192 | ||
| 193 | # Default basepath | 193 | # Default basepath |
| 194 | basepath = os.path.dirname(os.path.abspath(__file__)) | 194 | basepath = os.path.dirname(os.path.abspath(__file__)) |
| 195 | pth = basepath | ||
| 196 | while pth != '' and pth != os.sep: | ||
| 197 | if os.path.exists(os.path.join(pth, '.devtoolbase')): | ||
| 198 | context.fixed_setup = True | ||
| 199 | basepath = pth | ||
| 200 | break | ||
| 201 | pth = os.path.dirname(pth) | ||
| 202 | 195 | ||
| 203 | parser = argparse_oe.ArgumentParser(description="OpenEmbedded development tool", | 196 | parser = argparse_oe.ArgumentParser(description="OpenEmbedded development tool", |
| 204 | add_help=False, | 197 | add_help=False, |
| @@ -224,11 +217,22 @@ def main(): | |||
| 224 | if global_args.basepath: | 217 | if global_args.basepath: |
| 225 | # Override | 218 | # Override |
| 226 | basepath = global_args.basepath | 219 | basepath = global_args.basepath |
| 227 | elif not context.fixed_setup: | 220 | if os.path.exists(os.path.join(basepath, '.devtoolbase')): |
| 228 | basepath = os.environ.get('BUILDDIR') | 221 | context.fixed_setup = True |
| 229 | if not basepath: | 222 | else: |
| 230 | logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)") | 223 | pth = basepath |
| 231 | sys.exit(1) | 224 | while pth != '' and pth != os.sep: |
| 225 | if os.path.exists(os.path.join(pth, '.devtoolbase')): | ||
| 226 | context.fixed_setup = True | ||
| 227 | basepath = pth | ||
| 228 | break | ||
| 229 | pth = os.path.dirname(pth) | ||
| 230 | |||
| 231 | if not context.fixed_setup: | ||
| 232 | basepath = os.environ.get('BUILDDIR') | ||
| 233 | if not basepath: | ||
| 234 | logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)") | ||
| 235 | sys.exit(1) | ||
| 232 | 236 | ||
| 233 | logger.debug('Using basepath %s' % basepath) | 237 | logger.debug('Using basepath %s' % basepath) |
| 234 | 238 | ||
