Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 35244 - /usr/portage/eclass/kernel-mod.eclass using basename with wrong VAR
Summary: /usr/portage/eclass/kernel-mod.eclass using basename with wrong VAR
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-07 02:42 UTC by Christian Rubbert
Modified: 2003-12-07 06:11 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 Christian Rubbert 2003-12-07 02:42:08 UTC
When merging e.g. /usr/portage/net-misc/nforce-net/nforce-net-1.0.0261-r2.ebuild, the following error crops up, although everything seems to work fine:

 * /usr/src/linux is a symbolic link
 * Determining the real directory of the Linux kernel source code
basename: zu wenige Argumente
,,basename --help" gibt weitere Informationen.

(which basically translated to not enough arguments to basename)

Patch to /usr/portage/eclass/kernel-mod.eclass appended

--- kernel-mod.eclass.original  2003-12-07 11:39:33.299841576 +0100
+++ kernel-mod.eclass   2003-12-07 11:39:36.291386792 +0100
@@ -39,7 +39,7 @@
                eerror "Directory '${KERNEL_DIR}' cannot be found"
                die
        fi
-       KV_DIR="`basename $KV_DIR`"
+       KV_DIR="`basename $KERNEL_DIR`"
 
        # now, we need to break that down into versions
Comment 1 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-07 03:52:39 UTC
this change is not correct, what's the output of:

ls -ld /usr/src/linux | awk '{print $11}'
Comment 2 Christian Rubbert 2003-12-07 04:26:34 UTC
Sorry?

wollschaf root # ls -ld /usr/src/linux | awk '{print $11}'

i.e. No output - empty

wollschaf root # ls -ld /usr/src/linux                    
lrwxrwxrwx    1 root     root           23 2003-12-03 18:24 /usr/src/linux -> linux-2.6.0-test10-mm1/
Comment 3 Stephane Loeuillet 2003-12-07 04:31:37 UTC
$11 would be empty :

$10 contains the path to which /usr/src/linux resolves

example :


ls -ld /usr/src/linux
lrwxrwxrwx    1 root     root           12 2003-11-29 12:41 /usr/src/linux -> linux-2.4.23

ls -ld /usr/src/linux | awk '{print $10}'
linux-2.4.23
Comment 4 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-07 05:15:25 UTC
here $11 contains the path to which it resolves to
Comment 5 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-07 05:18:57 UTC
what's your coreutils version?
Comment 6 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-07 05:22:38 UTC
try this:

ls -ld --full-time /usr/src/linux | awk '{ print $11 }'
Comment 7 Christian Rubbert 2003-12-07 05:25:05 UTC
wollschaf root # basename --version
basename (GNU coreutils) 5.0.91

wollschaf root # ls -ld --full-time /usr/src/linux | awk '{ print $11 }'
linux-2.6.0-test10-mm1/

But, well, I'm actually quite confused now.. So $KV_DIR is correct after all?
Comment 8 Stephane Loeuillet 2003-12-07 05:25:15 UTC
ls -ld --full-time /usr/src/linux | awk '{ print $11 }'
linux-2.4.23

emerge -s "^coreutils$"
Searching...
[ Results for search key : ^coreutils$ ]
[ Applications found : 1 ]
  
*  sys-apps/coreutils
      Latest version available: 5.0.91-r1
      Latest version installed: 5.0.91-r1
Comment 9 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-07 05:29:44 UTC
yes, KV_DIR is correct, it will be set above:

KV_DIR="`ls -ld ${KERNEL_DIR} | awk '{ print $9 }'`"

but there seems to be a change in the behaviour of ls in the new coreutils, my ls ouputs:

lrwxrwxrwx    1 root     root           23 Dec 5 18:24 /usr/src/linux -> linux-2.6.0-test10-mm1/

whereas your's outputs:

lrwxrwxrwx    1 root     root           23 2003-12-03 18:24 /usr/src/linux -> linux-2.6.0-test10-mm1/

this can be fixed with the --full-time option
Comment 10 Christian Rubbert 2003-12-07 06:04:33 UTC
So I found a bug, just didn't quite understand what went wrong?

Bugger :)
Comment 11 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-07 06:11:05 UTC
correct ;)