Re: Yet Another test option

2011-07-06 Thread Chet Ramey
On 7/6/11 1:52 PM, Bruce Korb wrote: >>> I would not expect "sort -V" and a version test to disagree. >> >> The code that coreutils uses for 'sort -V' is part of gnulib - the >> filevercmp module. That file (filevercmp.c) is pretty stable nowadays, >> with the last algorithmic change being in Apr

Re: Yet Another test option

2011-07-06 Thread Eric Blake
On 07/06/2011 10:37 AM, Bruce Korb wrote: > On 07/06/11 09:03, Chet Ramey wrote: >>> /usr/bin/test ? >>> >>> Do this first in the binary then migrate to bash's test? >> >> I was actually making an argument for an entirely separate utility to do >> this. That could be a shell script encapsulating t

Re: Yet Another test option

2011-07-06 Thread Bruce Korb
On 07/06/11 10:19, Eric Blake wrote: Oh, that's rather heavyweight - a command substitution and 3 pipeline components. Why not just one child process, by using sort -c and a heredoc? is_eq=false is_lt=false if test "x$1" = "$x2"; then is_eq=true elif sort -cV el

Re: Yet Another test option

2011-07-06 Thread Chet Ramey
On 7/5/11 8:59 AM, Bruce Korb wrote: >> The issue is extremely nontrivial. > > The normal case is to sort full releases. The goal in "sort -V" was to make > the usual case easy, not to make an authoritative solution to the intractable > problem. In any event, Chet doesn't think there is sufficie

Re: Yet Another test option

2011-07-05 Thread Greg Wooledge
On Sun, Jul 03, 2011 at 11:41:02AM -0700, Bruce Korb wrote: > P.S. this check is really for any version below 2.6.27: > > - case $LINUXRELEASE in > - # ext4 was in 2.6.22-2.6.26 but not stable enough to use > - 2.6.2[0-9]*) enable_ext4='no' ;; > - *) . ;; > > and might have b

Re: Yet Another test option

2011-07-05 Thread Bruce Korb
Hi Greg, On Tue, Jul 5, 2011 at 5:20 AM, Greg Wooledge wrote: > The comment implies [2-6] but [0-6] is probably a safer bet, just in > case someone backported the driver to an older kernel. The code, itself, matched anything with a kernel version in the 20+something version, and my guess is that

Re: Yet Another test option

2011-07-03 Thread Bob Proulx
Bruce Korb wrote: > I wouldn't know. I use it myself a bit and I am now playing with > Lustre fs code where they get it wrong because it is inconvenient to > get it right. After seeing that, I thought I'd suggest it. > ... > P.S. this check is really for any version below 2.6.27: > > - case

Re: Yet Another test option

2011-07-03 Thread Bruce Korb
Hi Chet, On Sun, Jul 3, 2011 at 11:21 AM, Chet Ramey wrote: > On 7/2/11 3:49 PM, Bruce Korb wrote: >> Hi Chet, et al., >> >> Given that sort(1GNU) now has a sort-by-version-ordering (sort -V), >> it would seem reasonable to do version comparisons without having >> to do a series of fork & execs.

Re: Yet Another test option

2011-07-03 Thread Chet Ramey
On 7/2/11 3:49 PM, Bruce Korb wrote: > Hi Chet, et al., > > Given that sort(1GNU) now has a sort-by-version-ordering (sort -V), > it would seem reasonable to do version comparisons without having > to do a series of fork & execs. In other words, abbreviate this: > > min_os_ver=` > prin