summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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():
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