Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] portable mechanism to determine noatime
- X-seq: zsh-workers 37322
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] portable mechanism to determine noatime
- Date: Sun, 06 Dec 2015 02:25:47 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1449365148; bh=42EmLLxIsByy+6DSnoD4HX5dG4ueQlvvHy/fpyjW3a4=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=KasQzjPYxADnR0+rPzva13JdbH2naESo2eIUQvEYy9N5uMo0xbpRpxe72d/vNvz4s8F/l4Ow1rzWtkgYaDfzgzU8ftcX8Ibxo8fSn7bAwVfhQEmHrwPmFqXCiwa+cJuiocBgM6AmliZJWvruQLhjuFlnBPkSDqXAdVmm4qrQ8DxawI2yY0XpF7bcfgZzVMVTk6Ay9EB25/kvoUF6/qAUoI62LP3Pr3D/h6pt8apVC/eCevdEJvJCpiTuKoPUxSB2ppb+tLnKR2zgL9JVQ3SJUCahtEtfiErHAJ/WLCJaCFVLIGidXGJimL6kwsvqE4j5QDvyXxP4hKZlLi6WiyUqJA==
- In-reply-to: <CAGnh9tAC0G7iLenGYWHyJdLNa3VfWZRYQgBqePc=D-HgL3S8DQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAPKC6oKUAu0LWzfWuaSbX3iQymhUmZg-35jf9SzrjMv4s=7HQA@mail.gmail.com> <566272DD.6010305@gmx.com> <56632A3A.6000002@gmx.com> <CAGnh9tAC0G7iLenGYWHyJdLNa3VfWZRYQgBqePc=D-HgL3S8DQ@mail.gmail.com>
Matthew Martin wrote:
> >> This patch doesn't work on illumos/solaris systems.
> >>
> > Well, it isn't just unique to illumos/solaris.
> > If you build zsh in a directory that is on your root partition (say you don't have a separate /home partition)
> > `df .' returns `/', `grep /' matches every mount point and if any mount point is mounted noatime, the final grep succeeds.
> > But that problem still exist with the use of /etc/mtab.
>
> What about
> mount | awk '$1 == "'"$(df . | tail -n 1 | cut -d\ -f1)"\" | grep -q noatime
The problems on Solaris are:
mount is in /sbin which is likely not to be in $path
- we could use { mount || /sbin/mount } 2>/dev/null
the default output from df is different.
- use df -k .
tail has no -n option, there is /usr/xpg4/bin but
- use tail -1
grep has no -q option
- redirect to /dev/null
mount output has the filesystem in $1 and device in $3: opposite of Linux/BSD
- perhaps grep for the filesystem with a trailing space
Something like:
{mount || /sbin/mount} 2>/dev/null |grep $(df -k .|tail -1 |awk '{print $1}')" .*noatime" >/dev/null
That will still break for strange characters in the mount point.
Whatever we do is probably going to be more fragile than the actual test
case it skips - [[ -N ... ]]. Perhaps we should redo the test case to
only check that -N agrees with a manual comparison after using the zstat
module.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author