create-mar: flush stdout to see the message when using 2>&1 | tee log

in case the script is aborted/fails otherwise and doesn't remove the
lockfile, another attempt to obtain the lock ends up in an endless loop

No problem if the user sees the corresponing messages, but when using
shell redirection of stdout and stderr and trying to tee that to a
logfile, the message is never seen/the buffers are not flushed

So force flushing stdout to have the message show up in the terminal

Change-Id: Ib133b9bc523d9ba2210564f75762258f41415f71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182595
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Christian Lohmaier
2025-03-07 13:18:36 +01:00
parent 33b411c515
commit 55b13db9f1
+1
View File
@@ -22,6 +22,7 @@ def waitforlock(lockfile):
break
except OSError:
print("waiting for lockfile/msiexec already running, sleeping 10s")
sys.stdout.flush()
time.sleep(10)
def releaselock(lockfile):