Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2196 - nvidia-kernel ebuild teeny little patch
Summary: nvidia-kernel ebuild teeny little patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Arcady Genkin (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-28 14:53 UTC by Jon Nelson (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
0 users

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 Jon Nelson (RETIRED) 2002-04-28 14:53:37 UTC
here's a teeny little patch that fixes some problems with the nvidia-kernel
ebuild when /usr/src/linux does *not* point to /usr/src/<some_kernel_version>,
such as a kernel directory in somebody's home directory.

Only people with this setup should notice a difference.

Index: nvidia-kernel-1.0.2880.ebuild
===================================================================
RCS file:
/home/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.2880.ebuild,v
retrieving revision 1.2
diff -u -r1.2 nvidia-kernel-1.0.2880.ebuild
--- nvidia-kernel-1.0.2880.ebuild       2002/04/25 06:56:22     1.2
+++ nvidia-kernel-1.0.2880.ebuild       2002/04/28 19:53:24
@@ -22,6 +22,7 @@
 nv_get_kernel_version () {
        # Determine the version of the kernel sources
        local NV_KV="`readlink /usr/src/linux`"
+       NV_KV="`basename $NV_KV`"
        if [ $? -ne 0 ]
        then
                die "/usr/src/linux does not exist"
Comment 1 Arcady Genkin (RETIRED) gentoo-dev 2002-04-28 21:45:33 UTC
I'll take this bug.
Comment 2 Arcady Genkin (RETIRED) gentoo-dev 2002-04-28 22:21:39 UTC
I actually got rid of the nv_get_kernel_version function altogether (in the
version 1.3 of the ebuild), because portage sets $KV variable automatically. 
Could you test whether portage makes the same kind of mistake?  If it does,
please open a new bug about this.

Thanks.
Comment 3 Jon Nelson (RETIRED) 2002-04-28 22:57:29 UTC
Nope.
Doesn't work.
>>> Completed installing into /var/tmp/portage/nvidia-kernel-1.0.2880/image/

etc/
etc/modules.d/
etc/modules.d/nvidia
lib/
lib/modules/
lib/modules/home/
lib/modules/home/jnelson/
lib/modules/home/jnelson/kernel/
lib/modules/home/jnelson/kernel/2.4.17-r5/
lib/modules/home/jnelson/kernel/2.4.17-r5/kernel/
...

Comment 4 Jon Nelson (RETIRED) 2002-04-28 22:58:02 UTC
Additionally, why wasn't the ebuild -r value increased?
Comment 5 Arcady Genkin (RETIRED) gentoo-dev 2002-04-28 23:15:12 UTC
So this becomes a bug in portage now, for it (portage) doesn't set the KV
environment variable properly.  Please open a new bug report for this, as it is
no longer specific to nvidia ebuild.

To answer your second question, I chose not to increment the ebuild's revision
becase this is an entirely internal fix, i.e. it contains no user-visible
changes.  There will be no difference on your system after you install this new
version of the ebuild, compared to the previous version.

Thanks.
Comment 6 Jon Nelson (RETIRED) 2002-04-29 08:34:13 UTC
I disagree. It's not portage's *job* to tell me what kernel I'm compiling a
module for.  What was wrong with the patch I sent you? It worked for all the
test cases I threw at it, although it *could* use more error checking, like "no
/usr/src/linux exists" and so on.

Comment 7 Arcady Genkin (RETIRED) gentoo-dev 2002-04-29 10:04:19 UTC
Jon, it *is* portage's job to tell you that.  That task is quite generic and is
called for by several more ebuilds (e.g. see alsa-driver and em8300-modules). 
That was why drobbins added the functionality to Portage in the first place (see
bug 599).  The function nv_get_kernel_version was written (by me) because KV
environment variable was not available at the time.  Now KV variable is the
``official'' way of detecting the current kernel version in an ebuild, so the
function has to go.

Otherwise, there is nothing wrong with the patch that you sent.  But understand,
that the bug that you discovered also affects at least two more ebuilds.  That
is why I'm saying, again, that it should be reported as a separate portage bug.
 This way you can fix it in *one* place, and thus all the packages that compile
kernel modules will be fixed.

Thanks.
Comment 8 Jon Nelson (RETIRED) 2002-04-29 20:08:51 UTC
I checked the source (Luke), and yep - ebuild.sh does set KV.
So I wrote some new code to handle that (for portage).
This bug is closed, and thanks for setting me right!
Comment 9 Arcady Genkin (RETIRED) gentoo-dev 2002-05-03 00:24:48 UTC
So, is this bug fixed in the latest portage?  If so, in which version?  Looks
like bug 2374 may be about the same issue.

Thanks.