summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
-rw-r--r--scripts/lib/devtool/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index c9d7ade9ff..396e8025b7 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -26,7 +26,7 @@ class DevtoolError(Exception):
26 26
27def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): 27def exec_build_env_command(init_path, builddir, cmd, watch=False, **options):
28 """Run a program in bitbake build context""" 28 """Run a program in bitbake build context"""
29 import bb 29 import bb.process
30 if not 'cwd' in options: 30 if not 'cwd' in options:
31 options["cwd"] = builddir 31 options["cwd"] = builddir
32 if init_path: 32 if init_path:
@@ -50,7 +50,7 @@ def exec_build_env_command(init_path, builddir, cmd, watch=False, **options):
50 50
51def exec_watch(cmd, **options): 51def exec_watch(cmd, **options):
52 """Run program with stdout shown on sys.stdout""" 52 """Run program with stdout shown on sys.stdout"""
53 import bb 53 import bb.process
54 if isinstance(cmd, str) and not "shell" in options: 54 if isinstance(cmd, str) and not "shell" in options:
55 options["shell"] = True 55 options["shell"] = True
56 56
@@ -122,6 +122,7 @@ def setup_tinfoil(config_only=False, basepath=None, tracking=False):
122 122
123def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True): 123def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True):
124 """Parse the specified recipe""" 124 """Parse the specified recipe"""
125 import bb.providers
125 try: 126 try:
126 recipefile = tinfoil.get_recipe_file(pn) 127 recipefile = tinfoil.get_recipe_file(pn)
127 except bb.providers.NoProvider as e: 128 except bb.providers.NoProvider as e:
@@ -178,6 +179,7 @@ def use_external_build(same_dir, no_same_dir, d):
178 """ 179 """
179 Determine if we should use B!=S (separate build and source directories) or not 180 Determine if we should use B!=S (separate build and source directories) or not
180 """ 181 """
182 import bb.data
181 b_is_s = True 183 b_is_s = True
182 if no_same_dir: 184 if no_same_dir:
183 logger.info('Using separate build directory since --no-same-dir specified') 185 logger.info('Using separate build directory since --no-same-dir specified')
@@ -320,6 +322,7 @@ def replace_from_file(path, old, new):
320 try: 322 try:
321 rdata = read_file(path) 323 rdata = read_file(path)
322 except IOError as e: 324 except IOError as e:
325 import errno
323 # if file does not exit, just quit, otherwise raise an exception 326 # if file does not exit, just quit, otherwise raise an exception
324 if e.errno == errno.ENOENT: 327 if e.errno == errno.ENOENT:
325 return 328 return
@@ -339,6 +342,7 @@ def replace_from_file(path, old, new):
339def update_unlockedsigs(basepath, workspace, fixed_setup, extra=None): 342def update_unlockedsigs(basepath, workspace, fixed_setup, extra=None):
340 """ This function will make unlocked-sigs.inc match the recipes in the 343 """ This function will make unlocked-sigs.inc match the recipes in the
341 workspace plus any extras we want unlocked. """ 344 workspace plus any extras we want unlocked. """
345 import bb.utils
342 346
343 if not fixed_setup: 347 if not fixed_setup:
344 # Only need to write this out within the eSDK 348 # Only need to write this out within the eSDK
@@ -390,11 +394,13 @@ def check_prerelease_version(ver, operation):
390 394
391def check_git_repo_dirty(repodir): 395def check_git_repo_dirty(repodir):
392 """Check if a git repository is clean or not""" 396 """Check if a git repository is clean or not"""
397 import bb.process
393 stdout, _ = bb.process.run('git status --porcelain', cwd=repodir) 398 stdout, _ = bb.process.run('git status --porcelain', cwd=repodir)
394 return stdout 399 return stdout
395 400
396def check_git_repo_op(srctree, ignoredirs=None): 401def check_git_repo_op(srctree, ignoredirs=None):
397 """Check if a git repository is in the middle of a rebase""" 402 """Check if a git repository is in the middle of a rebase"""
403 import bb.process
398 stdout, _ = bb.process.run('git rev-parse --show-toplevel', cwd=srctree) 404 stdout, _ = bb.process.run('git rev-parse --show-toplevel', cwd=srctree)
399 topleveldir = stdout.strip() 405 topleveldir = stdout.strip()
400 if ignoredirs and topleveldir in ignoredirs: 406 if ignoredirs and topleveldir in ignoredirs: