From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10243 invoked by alias); 6 Dec 2015 01:32:21 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37322 Received: (qmail 1693 invoked from network); 6 Dec 2015 01:32:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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== X-Yahoo-Newman-Id: 879035.4340.bm@smtp105.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: bnNoeqEVM1lyEjblBeRVABhu7poTRxbR222wE4UGBXeTQ.O nIG6Jezb0Xj.tOV4UCGuTtWjeyvL..C_BmY_5PZAdSiVcUZfIcdIATuGRSlI .SYgdnmLU0z8hSL7cKV8OZ459azV0bxiUI1jKa.AICAzCGGRNWceXK7JLtri lCK8ZGt9MtXQ56nLt5Dp.UonKtYPAWdLf.yg4UR7vO9.F0hWzrCAIMkAkpOM hsXjSxWBKMz_nvISV1mTll3lstakvLQ.7wLvknal7tKvxgMWM880yn9dS8FF 1DS2JlGmMemCGLl_z8xJCaX0.qUOxZwbrz0ha6BCMOczbZBKvQhwvq9bQFXM xpA0ElboWJqmgT7uDSXjujeFgdPuki4S3WfLT47qjjCehyFoPjHLnXeZxT9x MpN5y5Cm08X2e8CvPqh2rJoD_KH8D9CJvGuJ2AYABvGcoI.oumC5ml5m2t2w pm.oZsGpuyej2QRacfPOf1XGA9DvXN0vq.TEbsq.XyNOkxzp1fJ8TdX9gggE PBNjeP3Z9Dpg15Mx6r22H8AJIQNrndz3E X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: From: Oliver Kiddle References: <566272DD.6010305@gmx.com> <56632A3A.6000002@gmx.com> To: zsh-workers@zsh.org Subject: Re: [PATCH] portable mechanism to determine noatime MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11849.1449365146.1@thecus.kiddle.eu> Date: Sun, 06 Dec 2015 02:25:47 +0100 Message-ID: <11850.1449365147@thecus.kiddle.eu> 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