mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
bitbake: knotty.py: Make sure bitbake.lock is unlocked before exiting
Before exiting the UI, unlocks the bitbake.lock owned by cooker; this way consecutive bitbake executions can lock it again without trouble. [Yocto #7941] (Bitbake rev: 69ecd15aece54753154950c55d7af42f85ad8606) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
67eaefee29
commit
3b5b74b430
@@ -310,6 +310,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
|
|||||||
errors = 0
|
errors = 0
|
||||||
warnings = 0
|
warnings = 0
|
||||||
taskfailures = []
|
taskfailures = []
|
||||||
|
locktries = 10
|
||||||
|
|
||||||
termfilter = tf(main, helper, console, errconsole, format)
|
termfilter = tf(main, helper, console, errconsole, format)
|
||||||
atexit.register(termfilter.finish)
|
atexit.register(termfilter.finish)
|
||||||
@@ -537,6 +538,25 @@ def main(server, eventHandler, params, tf = TerminalFilter):
|
|||||||
_, error = server.runCommand(["stateForceShutdown"])
|
_, error = server.runCommand(["stateForceShutdown"])
|
||||||
main.shutdown = 2
|
main.shutdown = 2
|
||||||
try:
|
try:
|
||||||
|
topdir, error = server.runCommand(["getVariable", "TOPDIR"])
|
||||||
|
if error:
|
||||||
|
logger.warn("Unable to get the value of TOPDIR variable: %s" % error)
|
||||||
|
else:
|
||||||
|
lockfile = "%s/bitbake.lock" % topdir
|
||||||
|
_, error = server.runCommand(["unlockBitbake"])
|
||||||
|
if error:
|
||||||
|
logger.warn("Unable to unlock the file %s" % lockfile)
|
||||||
|
else:
|
||||||
|
while locktries:
|
||||||
|
lf = bb.utils.lockfile(lockfile, False, False)
|
||||||
|
if not lf:
|
||||||
|
time.sleep(1)
|
||||||
|
locktries -=1
|
||||||
|
else:
|
||||||
|
bb.utils.unlockfile(lf)
|
||||||
|
break
|
||||||
|
if not locktries:
|
||||||
|
logger.warn("Knotty could not lock the file ${TOPDIR}/bitbake.lock, probably locked by cooker and not unlocked yet. Immediate bitbake commands may failed")
|
||||||
summary = ""
|
summary = ""
|
||||||
if taskfailures:
|
if taskfailures:
|
||||||
summary += pluralise("\nSummary: %s task failed:",
|
summary += pluralise("\nSummary: %s task failed:",
|
||||||
|
|||||||
Reference in New Issue
Block a user