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

Re: [PATCH] portable mechanism to determine noatime



On 13 Dec, I wrote:
> df is adjusting the
> column widths according to maximum lengths of fields. That ends up
> varying between the one fs run and the multple fs run of df. That can be
> solved by piping to tr -s ' ' or wrapping it in ${=...}.

So is there any advance on the patch below or shall I commit it in
this form?

Oliver

diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst
index 9e13696..0b4608a 100644
--- a/Test/C02cond.ztst
+++ b/Test/C02cond.ztst
@@ -154,7 +154,7 @@
     ZTST_skip="[[ -N file ]] not supported on Cygwin"
   elif (( isnfs )); then
     ZTST_skip="[[ -N file ]] not supported with NFS"
-  elif test -f /etc/mtab && { grep $(df . 2>/dev/null| tail -n1 | awk '{print $1}') /etc/mtab | grep -q noatime; }; then
+  elif { df -k -- ${$({mount || /sbin/mount} | awk '/noatime/ {print $1,$3}'):-""} | tr -s ' ' | fgrep "$(df -k . | tail -1 | tr -s ' ')" } >&/dev/null; then
     ZTST_skip="[[ -N file ]] not supported with noatime file system"
   else
     [[ -N $newnewnew && ! -N $unmodified ]]



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