changeset 49230:a68b37524d50

wait-on-file: properly wait on any files and symlink This make the utility more useful, for example to wait on a lock file. We also add an explicit -L check since the lock are "weird" symlink. Differential Revision: https://phab.mercurial-scm.org/D12617
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Apr 2022 04:43:34 +0200
parents 883be4c74d54
children 575f3dedb69a
files tests/testlib/wait-on-file
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/testlib/wait-on-file	Tue Apr 05 04:41:09 2022 +0200
+++ b/tests/testlib/wait-on-file	Tue Apr 05 04:43:34 2022 +0200
@@ -29,7 +29,7 @@
     touch "$create"
     create=""
 fi
-while [ "$timer" -gt 0 ] && [ ! -f "$wait_on" ]; do
+while [ "$timer" -gt 0 ] && !([ -e "$wait_on" ] || [ -L "$wait_on" ]) ; do
     timer=$(( $timer - 1))
     sleep 0.02
 done