Subject: Bug in C02cont.ztst's -N test
From: Jason L Tibbitts III <[email-masked]>
To: [email-masked]
Date: Thu, 28 Apr 2016 19:20:55 -0500
List-Id: Zsh Workers List <zsh-workers.zsh.org>

C02cont.ztst has a test for -N which tries to disable itself if the
filesystem is mounted with noatime:

  if [[ $OSTYPE == "cygwin" ]]; then
    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
    ZTST_skip="[[ -N file ]] not supported with noatime file system"
  else
    [[ -N $newnewnew && ! -N $unmodified ]]
  fi

When building zsh in a chroot created by the "mock" tool (used in Fedora
and derivatives to build packages in a clean chroot) it's possible for
"df ." to give the following:

Filesystem     1K-blocks      Used Available Use% Mounted on
-              492127564 331926080 135179772  72% /

And, of course, "grep - /etc/mtab" errors out.

I guess the shortest solution is to add "--" in there, but that isn't
going to help the test do what it's supposed to do.

 - J<