pmb.helpers.frontend: Also clear testsuite log when running log -c

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230603102910.164433-1-newbyte@postmarketos.org%3E
This commit is contained in:
Newbyte 2023-06-03 12:29:10 +02:00 committed by Oliver Smith
parent d31313f7dc
commit 09870a46a0
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 3 additions and 1 deletions

View File

@ -531,14 +531,16 @@ def work_migrate(args):
def log(args):
log_testsuite = f"{args.work}/log_testsuite.txt"
if args.clear_log:
pmb.helpers.run.user(args, ["truncate", "-s", "0", args.log])
pmb.helpers.run.user(args, ["truncate", "-s", "0", log_testsuite])
cmd = ["tail", "-n", args.lines, "-F"]
# Follow the testsuite's log file too if it exists. It will be created when
# starting a test case that writes to it (git -C test grep log_testsuite).
log_testsuite = f"{args.work}/log_testsuite.txt"
if os.path.exists(log_testsuite):
cmd += [log_testsuite]