From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] portable mechanism to determine noatime
Date: Sun, 06 Dec 2015 02:25:47 +0100 [thread overview]
Message-ID: <11850.1449365147@thecus.kiddle.eu> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2015-12-06 1:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 23:22 Baptiste Daroussin
2015-12-05 5:15 ` Eric Cook
2015-12-05 18:17 ` Eric Cook
2015-12-05 20:00 ` Matthew Martin
2015-12-06 1:25 ` Oliver Kiddle [this message]
2015-12-10 8:48 ` Bart Schaefer
2015-12-10 8:55 ` Bart Schaefer
2015-12-11 4:21 ` Oliver Kiddle
2015-12-12 6:49 ` Bart Schaefer
2015-12-13 2:13 ` Oliver Kiddle
2015-12-13 16:22 ` Bart Schaefer
2015-12-18 2:45 ` Oliver Kiddle
2015-12-18 4:40 ` Bart Schaefer
2015-12-30 17:49 ` Oliver Kiddle
2015-12-30 22:43 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11850.1449365147@thecus.kiddle.eu \
--to=okiddle@yahoo.co.uk \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).