apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55690] Linux kernel version check broken
Date Wed, 23 Oct 2013 15:37:57 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55690

--- Comment #2 from Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com> ---
(I do not use old kernels anymore.)

Your solution does not work for 4.0.* versions. If also fails when the last
".0" is skipped.
I have tested your solution in shell by defining uname() function.

$ uname() { echo 3.11.6; }
$ os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`
$ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'`
$ declare -p os_major os_minor
declare -- os_major="3"
declare -- os_minor="11"
$ uname() { echo 4.0.1; }
$ os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`
$ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'`
$ declare -p os_major os_minor
declare -- os_major="4"
declare -- os_minor="4.0.1"
$ uname() { echo 3.12; }
$ os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`
$ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'`
$ declare -p os_major os_minor
declare -- os_major="3"
declare -- os_minor="3.12"

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message