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.
Maybe this function could be called "mykernel"? Dunno.
I have no preference. Actually, I really hate "my*" names, because they are so microsoftish, but that's totally beyond the point. ;^)
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.