Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in C02cont.ztst's -N test



On Sat, Apr 30, 2016 at 12:46:39AM +0000, Daniel Shahaf wrote:
> Bonus points if there's a way to write the condition portably without
> relying on _other_ zsh functionality...

That was discussed on IRC last night.

diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst
index 88cad0d..8343fe2 100644
--- a/Test/C02cond.ztst
+++ b/Test/C02cond.ztst
@@ -23,6 +23,7 @@
   zlnfs=${filetmpprefix}zlnfs
 
   touch $unmodified
+  unmodified_ls="$(ls -lu $unmodified)"
 
   touch zerolength
   chgrp $EGID zerolength
@@ -154,7 +155,7 @@
     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 sleep 58; [[ $unmodified_ls == "$(ls -lu $unmodified)" ]]; then
     ZTST_skip="[[ -N file ]] not supported with noatime file system"
   else
     [[ -N $newnewnew && ! -N $unmodified ]]

but who wants to sleep for 60 seconds? (There's a sleep 2 earlier.)

- Matthew Martin



Messages sorted by: Reverse Date, Date, Thread, Author