Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 14208 - function to check for kernel version
Summary: function to check for kernel version
Status: RESOLVED WORKSFORME
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-19 17:44 UTC by Thomas Raschbacher
Modified: 2011-10-30 22:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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