diff options
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 2bee242eb0..9788a9287c 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -310,6 +310,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
310 | errors = 0 | 310 | errors = 0 |
311 | warnings = 0 | 311 | warnings = 0 |
312 | taskfailures = [] | 312 | taskfailures = [] |
313 | locktries = 10 | ||
313 | 314 | ||
314 | termfilter = tf(main, helper, console, errconsole, format) | 315 | termfilter = tf(main, helper, console, errconsole, format) |
315 | atexit.register(termfilter.finish) | 316 | atexit.register(termfilter.finish) |
@@ -537,6 +538,25 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
537 | _, error = server.runCommand(["stateForceShutdown"]) | 538 | _, error = server.runCommand(["stateForceShutdown"]) |
538 | main.shutdown = 2 | 539 | main.shutdown = 2 |
539 | try: | 540 | try: |
541 | topdir, error = server.runCommand(["getVariable", "TOPDIR"]) | ||
542 | if error: | ||
543 | logger.warn("Unable to get the value of TOPDIR variable: %s" % error) | ||
544 | else: | ||
545 | lockfile = "%s/bitbake.lock" % topdir | ||
546 | _, error = server.runCommand(["unlockBitbake"]) | ||
547 | if error: | ||
548 | logger.warn("Unable to unlock the file %s" % lockfile) | ||
549 | else: | ||
550 | while locktries: | ||
551 | lf = bb.utils.lockfile(lockfile, False, False) | ||
552 | if not lf: | ||
553 | time.sleep(1) | ||
554 | locktries -=1 | ||
555 | else: | ||
556 | bb.utils.unlockfile(lf) | ||
557 | break | ||
558 | if not locktries: | ||
559 | logger.warn("Knotty could not lock the file ${TOPDIR}/bitbake.lock, probably locked by cooker and not unlocked yet. Immediate bitbake commands may failed") | ||
540 | summary = "" | 560 | summary = "" |
541 | if taskfailures: | 561 | if taskfailures: |
542 | summary += pluralise("\nSummary: %s task failed:", | 562 | summary += pluralise("\nSummary: %s task failed:", |