Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
From: Jason L Tibbitts III <tibbs@math.uh.edu>
To: zsh-workers@zsh.org
Subject: Bug in C02cont.ztst's -N test
Date: Thu, 28 Apr 2016 19:20:55 -0500
Message-ID: <ufa1t5pl0yg.fsf@epithumia.math.uh.edu>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Seq: zsh-workers 38355

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<

