diff options
Diffstat (limited to 'scripts/oe-setup-build')
-rwxr-xr-x | scripts/oe-setup-build | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/oe-setup-build b/scripts/oe-setup-build index 5364f2b481..c0476992a2 100755 --- a/scripts/oe-setup-build +++ b/scripts/oe-setup-build | |||
@@ -91,7 +91,16 @@ def setup_build_env(args): | |||
91 | builddir = args.b if args.b else template["buildpath"] | 91 | builddir = args.b if args.b else template["buildpath"] |
92 | no_shell = args.no_shell | 92 | no_shell = args.no_shell |
93 | coredir = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) | 93 | coredir = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) |
94 | cmd = "TEMPLATECONF={} . {} {}".format(template["templatepath"], os.path.join(coredir, 'oe-init-build-env'), builddir) | 94 | cmd_base = ". {} {}".format(os.path.join(coredir, 'oe-init-build-env'), os.path.abspath(builddir)) |
95 | |||
96 | initbuild = os.path.join(builddir, 'init-build-env') | ||
97 | if not os.path.exists(initbuild): | ||
98 | os.makedirs(builddir, exist_ok=True) | ||
99 | with open(initbuild, 'w') as f: | ||
100 | f.write(cmd_base) | ||
101 | print("\nRun '. {}' to initialize the build in a current shell session.\n".format(initbuild)) | ||
102 | |||
103 | cmd = "TEMPLATECONF={} {}".format(template["templatepath"], cmd_base) | ||
95 | if not no_shell: | 104 | if not no_shell: |
96 | cmd = cmd + " && {}".format(os.environ['SHELL']) | 105 | cmd = cmd + " && {}".format(os.environ['SHELL']) |
97 | print("Running:", cmd) | 106 | print("Running:", cmd) |