From 7937c1963e3f4f346db14e9ba5094555fb406e46 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 24 Aug 2018 19:18:05 +0200 Subject: [PATCH] libkas: Remove parameters from get_build_environ() All of them can be retrieved from the global context. Signed-off-by: Jan Kiszka --- kas/libcmds.py | 2 +- kas/libkas.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kas/libcmds.py b/kas/libcmds.py index 3123c18..370085e 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -149,7 +149,7 @@ class SetupEnviron(Command): return 'setup_environ' def execute(self, ctx): - ctx.environ.update(get_build_environ(ctx, ctx.build_dir)) + ctx.environ.update(get_build_environ()) class WriteBBConfig(Command): diff --git a/kas/libkas.py b/kas/libkas.py index 3b3733e..8a661c1 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -210,7 +210,7 @@ def repos_apply_patches(config, repos): sys.exit(task.result()) -def get_build_environ(context, build_dir): +def get_build_environ(): """ Create the build environment variables. """ @@ -220,7 +220,7 @@ def get_build_environ(context, build_dir): init_repo = None permutations = \ - [(repo, script) for repo in context.config.get_repos() + [(repo, script) for repo in get_context().config.get_repos() for script in ['oe-init-build-env', 'isar-init-build-env']] for (repo, script) in permutations: if os.path.exists(repo.path + '/' + script): @@ -248,7 +248,7 @@ def get_build_environ(context, build_dir): env = {} env['PATH'] = '/usr/sbin:/usr/bin:/sbin:/bin' - (_, output) = run_cmd([get_bb_env_file, build_dir], + (_, output) = run_cmd([get_bb_env_file, get_context().build_dir], cwd=init_repo.path, env=env, liveupdate=False) os.remove(get_bb_env_file) @@ -261,7 +261,7 @@ def get_build_environ(context, build_dir): except ValueError: pass - conf_env = context.config.get_environment() + conf_env = get_context().config.get_environment() env_vars = ['SSTATE_DIR', 'DL_DIR', 'TMPDIR'] env_vars.extend(conf_env)