From 3f10399db3693eefac751734087abad2c5e97c1a Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 7 Oct 2020 17:58:09 +0200 Subject: [PATCH] pmbootstrap log: use tail -F, not -f (MR 1982) Let tail attempt to open the file again, if it becomes inaccessible. This is useful, when writing a reproducer that deletes pmbootstrap's log.txt while at the same time running 'pmbootstrap log'. (027724) [17:57:34] Done tail: '/home/user/.local/var/pmbootstrap/log.txt' has become inaccessible: No such file or directory tail: '/home/user/.local/var/pmbootstrap/log.txt' has appeared; following new file (003493) [17:57:35] % cd /home/user/.local/var/pmbootstrap/cache_git/pmaports; git remote -v --- pmb/helpers/frontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmb/helpers/frontend.py b/pmb/helpers/frontend.py index 0c8a357b..d8cd0be2 100644 --- a/pmb/helpers/frontend.py +++ b/pmb/helpers/frontend.py @@ -451,7 +451,7 @@ def work_migrate(args): def log(args): if args.clear_log: pmb.helpers.run.user(args, ["truncate", "-s", "0", args.log]) - pmb.helpers.run.user(args, ["tail", "-f", args.log, "-n", args.lines], + pmb.helpers.run.user(args, ["tail", "-F", args.log, "-n", args.lines], output="tui")