From owner-svn-src-all@FreeBSD.ORG Wed Feb 27 00:01:28 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA6F952A; Wed, 27 Feb 2013 00:01:28 +0000 (UTC) (envelope-from grog@lemis.com) Received: from w3.lemis.com (w3.lemis.com [208.86.224.149]) by mx1.freebsd.org (Postfix) with ESMTP id 75B6AA4F; Wed, 27 Feb 2013 00:01:28 +0000 (UTC) Received: from eureka.lemis.com (1032.x.rootbsd.net [208.86.224.149]) by w3.lemis.com (Postfix) with ESMTP id BB0833B736; Wed, 27 Feb 2013 00:01:26 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 7D460F74FA; Wed, 27 Feb 2013 11:01:25 +1100 (EST) Date: Wed, 27 Feb 2013 11:01:25 +1100 From: Greg 'groggy' Lehey To: Jilles Tjoelker Subject: Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test Message-ID: <20130227000125.GA7223@eureka.lemis.com> References: <201302251905.r1PJ5fKF085179@svn.freebsd.org> <20130226000227.GA80718@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <20130226000227.GA80718@stack.nl> User-Agent: Mutt/1.4.2.3i Organization: The FreeBSD Project Phone: +61-3-5346-1370 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Peter Jeremy , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 00:01:28 -0000 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 26 February 2013 at 1:02:27 +0100, Jilles Tjoelker wrote: > On Mon, Feb 25, 2013 at 07:05:41PM +0000, Peter Jeremy wrote: >> Author: peterj >> Date: Mon Feb 25 19:05:40 2013 >> New Revision: 247274 >> URL: http://svnweb.freebsd.org/changeset/base/247274 > >> Log: >> Enhance test(1) by adding provision to compare any combination of the >> access, birth, change and modify times of two files, instead of only >> being able to compare modify times. The builtin test in sh(1) will >> automagically acquire the same expansion. > >> Approved by: grog >> MFC after: 2 weeks > > What do you need this for? Lots of things. For example, I need it to compare photos I have created and then set the timestamp to the time of exposure. The only way I can establish that the image is newer is via the creation timestamp. In the past I've wished I had the functionality for other reasons I now forget. Peter has other reasons again. I expect other users to also find this useful. Arguably comparing different kinds of timestamps is not very useful, but then, that's "arguably". Others might find a use for it. > If it is not needed very often, this test can > be done more portably (older FreeBSD and GNU) as > [ -n "$(find -L FILE1 -prune -newerXY FILE2 2>/dev/null)" ] That's really ugly. It's also difficult for the casual reader to understand. > I have generally been rather reluctant in adding things to sh(1) and > even more so if they are completely new. Someone proposed something > rather similar (except that it added a time string parser -- even more > code) in PR bin/57054 and I rejected it in 2009. That was a much larger chunk of code. And times change. In December 1998 I added an -S option to ls(1), and jkh (my mentor) refused it on the basis of bloat. In June 2005, keramida submitted similar functionality, and it was committed as revision 146924. It's also functionality that I use frequently. Re bloat. Here's before and after: text data bss dec hex filename 25645 1152 4720 31517 7b1d /bin/ls 26718 1168 4840 32726 7fd6 /bin/ls A little over a kilobyte. Peter even went to the trouble of keeping the size of the operator table entries the same. I think the additional size is justifiable. Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft MUA reports problems, please read http://tinyurl.com/broken-mua --RnlQjJ0d97Da+TV1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlEtTNQACgkQIubykFB6QiO7sQCfc/WV5Xbi4kxv+tn+1EMR6LCO DroAn3dbK/kQpgRG2xuJflfqmK389BN6 =NPID -----END PGP SIGNATURE----- --RnlQjJ0d97Da+TV1--