Package: module-assistant
Version: 0.10.11
Severity: normal
Tags: patch
If --kernel-dir is provided, and @opt_kverslist is therefore empty,
prep() will fail at line 566. And since it is called by auto-install,
this makes it impossible to use this handy little command for custom
kernels.
I see three possible ways to fix this:
1) Don't call prep() unless @opt_kverslist. This has the unfortunate
side-effect of also disabling the install of build-essential.
2) Run $todo foreach @opt_kverslist in prep(). This potentially calls
apt-get multiple times (which is annoying if there's a yes/no
question each time), and renders the whole idea of the
/usr/src/linux symlink somewhat moot.
3) Replace the for with a if($todo = ...). This is the simplest, and
works fine for me. I'm attaching a measily patch that does this.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.21-2-k7 (SMP w/1 CPU core)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- /usr/bin/module-assistant.orig 2007-08-12 14:02:11.000000000 +0000
+++ /usr/bin/module-assistant 2007-08-12 17:57:59.000000000 +0000
@@ -560,7 +560,7 @@
print "chdir $usrc\n" if $opt_debug;
%envbackup=%ENV;
$ENV{ROOT_CMD}=$sudo if ($sudo && !$ENV{ROOT_CMD});
- for $todo ($opt_kverslist[0]) {
+ if ($todo = $opt_kverslist[0]) {
my $kheaders = get_kpackage($todo)."-headers";
$source=$kerneldirs{$todo};
die "Bad kernel version specification" if ! $todo;