Package: module-assistant
Version: 0.9.10
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I try to avoid to run compilers as root, so I really like the user mode
of module-assistant, I also use it to build packages for slower
machines. I tried to build loop-aes which needs a complete kernel
source and saw that fakesource would not run in user mode. The attached
patch fixes this and also make -l work for kernels installed with this.
I hope it does not affect the root mode.

Greetings Tobi

- -- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.12-1-k7
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages module-assistant depends on:
ii  libtext-wrapi18n-perl         0.06-2     internationalized substitute of Te
ii  perl                          5.8.7-5    Larry Wall's Practical Extraction 

Versions of packages module-assistant recommends:
ii  liblocale-gettext-perl        1.05-1     Using libc functions for internati

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDSFWqGf7YPOK+o0ERAr3UAKC3/1e3xljOWTuUl5/HPY+RoqP+igCg8xDn
GDMfkQp5JjkwQPENHj6FCxo=
=txm5
-----END PGP SIGNATURE-----
--- /usr/bin/module-assistant   2005-09-24 12:20:53.000000000 +0200
+++ /home/tobias/bin/module-assistant   2005-10-09 01:17:49.929308526 +0200
@@ -1138,6 +1138,7 @@
    my $knmbr=$kvers;
    $knmbr=~s/^([\d\.]+)(.*)/$1/;
    my $extra=$2;
+   my $writedir=(-d $opt_userdir)?$opt_userdir."/usr_src":$usrc;
    my $confile="/boot/config-$kvers";
    my $kheaders=get_kpackage($kvers)."-headers";
    my $ksource=get_kpackage($kvers)."-source";
@@ -1150,23 +1151,23 @@
       return 0 if withecho "$sudo apt-get ".($opt_noninter?"-y":"")." install 
$kheaders-$kvers";
       $confile="$usrc/$kheaders-$kvers/.config";
    }
-   $tmpdir="$usrc/tmp-".rand;
+   $tmpdir="$writedir/tmp-".rand;
    mkdir $tmpdir;
    # show the user what's going on
    print gettext("Extracting pristine kernel source, please wait...") . "\n";
    return 0 if withecho "cd $tmpdir ; tar jxf $usrc/$ksource-$knmbr.tar.bz2";
    print gettext("Installing to final location and configuring, please 
wait...") . "\n";
-   withecho "mv", "$tmpdir/$ksource-$knmbr", "$usrc/$ksource-$kvers";
-   withecho "cp", $confile, "$usrc/$ksource-$kvers/.config";
+   withecho "mv", "$tmpdir/$ksource-$knmbr", "$writedir/$ksource-$kvers";
+   withecho "cp", $confile, "$writedir/$ksource-$kvers/.config";
    if (-f $symverfile) {
-      withecho "cp", $symverfile, "$usrc/$ksource-$kvers/Module.symvers";
+      withecho "cp", $symverfile, "$writedir/$ksource-$kvers/Module.symvers";
    }
    if (-f $compileh) {
-      withecho "cp", $compileh, 
"$usrc/$ksource-$kvers/include/linux/compile.h";
+      withecho "cp", $compileh, 
"$writedir/$ksource-$kvers/include/linux/compile.h";
    }
    rmdir $tmpdir;
    if($extra) {
-      open(mk,"<$usrc/$ksource-$kvers/Makefile");
+      open(mk,"<$writedir/$ksource-$kvers/Makefile");
       while(<mk>) {
          if($extra && s/^EXTRAVERSION.*/EXTRAVERSION=$extra\n/)
          {
@@ -1175,12 +1176,12 @@
          push(@mkcont,$_);
       }
       close(mk);
-      open(mk,">$usrc/$ksource-$kvers/Makefile");
+      open(mk,">$writedir/$ksource-$kvers/Makefile");
       print mk @mkcont;
       close(mk);
    }
 
-   withecho "cd $usrc/$ksource-$kvers ; make prepare || make oldconfig dep";
+   withecho "cd $writedir/$ksource-$kvers ; make prepare || make oldconfig 
dep";
    print "\n" . wrap('', '', sprintf(gettext("Faked kernel source for the 
Kernel %s.\nWarning: the configuration may not match the running kernel."), 
$kvers)) . "\n\n";
    &initksrc;
 }
@@ -1232,7 +1233,7 @@
    HAVEIT: foreach $kvers (@opt_kverslist) {
       next HAVEIT if(defined($kerneldirs{$kvers}));
       my $kheaders=get_kpackage($my_kvers)."-headers";
-      LOOKUP: foreach $poskdir ("$usrc/linux", "$usrc/$kheaders-$my_kvers", 
<$usrc/*>, </usr/local/src/*>, "/lib/modules/".$my_kvers."/build") {
+      LOOKUP: foreach $poskdir ("$usrc/linux", "$usrc/$kheaders-$my_kvers", 
<$usrc/*>, </usr/local/src/*>, "/lib/modules/".$my_kvers."/build", 
<$opt_userdir/usr_src/*>) {
          if(-e $poskdir && (-d $poskdir || -d readlink($poskdir))) {
             if(!-x $poskdir) {
                if(!$opt_quiet) {

Reply via email to