Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 14208

Summary: function to check for kernel version
Product: Portage Development Reporter: Thomas Raschbacher <lordvan>
Component: UnclassifiedAssignee: Nicholas Jones (RETIRED) <carpaski>
Status: RESOLVED WORKSFORME    
Severity: normal CC: lordvan, vapier
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Thomas Raschbacher gentoo-dev 2003-01-19 17:44:26 UTC
hi!
u think u could add some script that checks for kernel versions? (like the
following script):
(if it'd be just a script in the /usr/lib/portage/bin i can write it if u want
me to)
check_kernel() {
     return `python -c "from os import environ
import sys
def kv2int(kv):
    return ((kv[0] << 16) + (kv[1] << 8) + kv[2])

v=map(int,environ['KV'].split('-')[0].split('.'))
if kv2int(v) >= kv2int([2,4,19]):
    sys.exit(0)
else:
    sys.exit(1)
"`
}
Comment 1 SpanKY gentoo-dev 2003-01-22 10:04:23 UTC
read /sbin/functions.sh