mirror of
https://git.code.sf.net/p/zsh/code
synced 2026-04-18 06:53:35 -04:00
38375 (tweaked per 38384): try harder to detect noatime filesystems.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2016-05-02 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 38375 (tweaked per 38384): Test/C02cond.ztst: try harder to
|
||||
detect noatime filesystems.
|
||||
|
||||
2016-05-02 Frank Terbeck <ft@bewatermyfriend.org>
|
||||
|
||||
* 38388: Completion/BSD/Command/_cu, Completion/Unix/Command/_gdb,
|
||||
|
||||
@@ -146,17 +146,29 @@
|
||||
|
||||
# can't be bothered with -S
|
||||
|
||||
print -u $ZTST_fd 'This test takes two seconds...'
|
||||
sleep 2
|
||||
cat $unmodified
|
||||
touch $newnewnew
|
||||
if [[ ${mtab::="$({mount || /sbin/mount})"} = *[(]?*[)] ]]; then
|
||||
print -u $ZTST_fd 'This test takes two seconds...'
|
||||
else
|
||||
unmodified_ls="$(ls -lu $unmodified)"
|
||||
print -u $ZTST_fd 'This test takes up to 60 seconds...'
|
||||
fi
|
||||
if [[ $OSTYPE == "cygwin" ]]; then
|
||||
ZTST_skip="[[ -N file ]] not supported on Cygwin"
|
||||
elif (( isnfs )); then
|
||||
ZTST_skip="[[ -N file ]] not supported with NFS"
|
||||
elif { df -k -- ${$({mount || /sbin/mount} | awk '/noatime/ {print $1,$3}'):-""} | tr -s ' ' | fgrep -- "$(df -k . | tail -1 | tr -s ' ')" } >&/dev/null; then
|
||||
elif { (( ! $+unmodified_ls )) &&
|
||||
{ sleep 2; cat $unmodified } &&
|
||||
{ df -k -- ${$(print -r -- "$mtab" |
|
||||
awk '/noatime/ {print $1,$3}'):-""} | tr -s ' ' |
|
||||
fgrep -- "$(df -k . | tail -1 | tr -s ' ')" } >&/dev/null } ||
|
||||
{ (( $+unmodified_ls )) && SECONDS=0 &&
|
||||
! until (( SECONDS >= 60 )); do
|
||||
ZTST_hashmark; sleep 2; cat $unmodified
|
||||
[[ $unmodified_ls != "$(ls -lu $unmodified)" ]] && break
|
||||
done }; then
|
||||
ZTST_skip="[[ -N file ]] not supported with noatime file system"
|
||||
else
|
||||
touch $newnewnew
|
||||
[[ -N $newnewnew && ! -N $unmodified ]]
|
||||
fi
|
||||
0:-N cond
|
||||
|
||||
Reference in New Issue
Block a user