From e96eb61680f0ee3b9a47029327ef25fc03421a3e Mon Sep 17 00:00:00 2001 From: Chris Laplante Date: Tue, 16 Sep 2025 11:51:42 -0400 Subject: devtool: __init__: cleanup imports, including a missing 'import errno' (From OE-Core rev: 9be824a14ea61ea97d717d25058231f9f09f07a0) Signed-off-by: Chris Laplante Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- scripts/lib/devtool/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts/lib/devtool/__init__.py') 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): def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): """Run a program in bitbake build context""" - import bb + import bb.process if not 'cwd' in options: options["cwd"] = builddir if init_path: @@ -50,7 +50,7 @@ def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): def exec_watch(cmd, **options): """Run program with stdout shown on sys.stdout""" - import bb + import bb.process if isinstance(cmd, str) and not "shell" in options: options["shell"] = True @@ -122,6 +122,7 @@ def setup_tinfoil(config_only=False, basepath=None, tracking=False): def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True): """Parse the specified recipe""" + import bb.providers try: recipefile = tinfoil.get_recipe_file(pn) except bb.providers.NoProvider as e: @@ -178,6 +179,7 @@ def use_external_build(same_dir, no_same_dir, d): """ Determine if we should use B!=S (separate build and source directories) or not """ + import bb.data b_is_s = True if no_same_dir: logger.info('Using separate build directory since --no-same-dir specified') @@ -320,6 +322,7 @@ def replace_from_file(path, old, new): try: rdata = read_file(path) except IOError as e: + import errno # if file does not exit, just quit, otherwise raise an exception if e.errno == errno.ENOENT: return @@ -339,6 +342,7 @@ def replace_from_file(path, old, new): def update_unlockedsigs(basepath, workspace, fixed_setup, extra=None): """ This function will make unlocked-sigs.inc match the recipes in the workspace plus any extras we want unlocked. """ + import bb.utils if not fixed_setup: # Only need to write this out within the eSDK @@ -390,11 +394,13 @@ def check_prerelease_version(ver, operation): def check_git_repo_dirty(repodir): """Check if a git repository is clean or not""" + import bb.process stdout, _ = bb.process.run('git status --porcelain', cwd=repodir) return stdout def check_git_repo_op(srctree, ignoredirs=None): """Check if a git repository is in the middle of a rebase""" + import bb.process stdout, _ = bb.process.run('git rev-parse --show-toplevel', cwd=srctree) topleveldir = stdout.strip() if ignoredirs and topleveldir in ignoredirs: -- cgit v1.2.3-54-g00ecf