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

Bug 599

Summary: Need kernel-version detection function or script in ebuilds
Product: Gentoo Linux Reporter: Arcady Genkin <agenkin-gentoo-bugzilla>
Component: New packagesAssignee: Geert Bevin <gbevin>
Status: RESOLVED FIXED    
Severity: normal CC: agenkin-gentoo-bugzilla
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 600    

Description Arcady Genkin 2002-02-08 00:44:28 UTC
Some portages need to know the version of the currently installed kernel (e.g.
nvidia-kernel, alsa-driver).  To avoid code duplication, we need have a function
or a script, accessible in the ebuilds, that would produce the needed value.

I adopted some code from the old nvidia ebuild to take a stab at such a
function.  It can be downloaded from here:

  http://cdf.toronto.edu/~agenkin/kernel_version

I don't have enough experience with the portage system to suggest whether it's
better to keep this as a shell script, or just to yank the function out of it
and put it someplace else.
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2002-02-08 10:51:16 UTC
Maybe this function could be called "mykernel"?  Dunno.
Comment 2 Arcady Genkin 2002-02-08 10:57:32 UTC
I have no preference.  Actually, I really hate "my*" names, because they are so
microsoftish, but that's totally beyond the point. ;^)
Comment 3 Daniel Robbins (RETIRED) gentoo-dev 2002-02-21 01:16:02 UTC
fixed on CVS.  KV is now automatically defined for all ebuilds, and will be set
to "" in the case that there's an error (rather than bombing out, which would be
bad).  Once we have this in a production Portage, developers can simply use $KV
with no other extra special steps.