diff options
| author | Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | 2017-08-07 12:21:50 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-09 09:24:15 +0100 |
| commit | c4b9c258d573a795a263a43dc9359f8fef0b594b (patch) | |
| tree | b81f224305f3bcd93f6ff9225287e54bbece64b1 | |
| parent | d97b2bdb0b468903a61041e163f203577b88986e (diff) | |
| download | poky-c4b9c258d573a795a263a43dc9359f8fef0b594b.tar.gz | |
Revert "cml1.bbclass: wait until menuconfig terminal finishes"
This reverts commit d2ebee7c3a0c8ab9a09ebad12a2fda51f8d10954.
(From OE-Core rev: da7bc68c399bbcd1baf946931200eba72268b0b3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/cml1.bbclass | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass index 0bab22efed..eb8e7907f6 100644 --- a/meta/classes/cml1.bbclass +++ b/meta/classes/cml1.bbclass | |||
| @@ -26,28 +26,8 @@ python do_menuconfig() { | |||
| 26 | except OSError: | 26 | except OSError: |
| 27 | mtime = 0 | 27 | mtime = 0 |
| 28 | 28 | ||
| 29 | # We need to know when the command completes but some terminals (including gnome-terminal | 29 | oe_terminal("${SHELL} -c \"make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'), |
| 30 | # and tmux) gives us no way to do this. We therefore write the pid to a temporal file | ||
| 31 | # then monitor the pid until it exits. | ||
| 32 | import tempfile | ||
| 33 | pidfile = tempfile.NamedTemporaryFile(delete = False).name | ||
| 34 | try: | ||
| 35 | oe_terminal("${SHELL} -c \"echo $$ > %s; make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % (pidfile, d.getVar('KCONFIG_CONFIG_COMMAND')), | ||
| 36 | d.getVar('PN') + ' Configuration', d) | 30 | d.getVar('PN') + ' Configuration', d) |
| 37 | while os.stat(pidfile).st_size <= 0: | ||
| 38 | continue | ||
| 39 | with open(pidfile, "r") as f: | ||
| 40 | pid = int(f.readline()) | ||
| 41 | finally: | ||
| 42 | os.unlink(pidfile) | ||
| 43 | |||
| 44 | import time | ||
| 45 | while True: | ||
| 46 | try: | ||
| 47 | os.kill(pid, 0) | ||
| 48 | time.sleep(0.1) | ||
| 49 | except OSError: | ||
| 50 | break | ||
| 51 | 31 | ||
| 52 | # FIXME this check can be removed when the minimum bitbake version has been bumped | 32 | # FIXME this check can be removed when the minimum bitbake version has been bumped |
| 53 | if hasattr(bb.build, 'write_taint'): | 33 | if hasattr(bb.build, 'write_taint'): |
