Package: modconf
Version: 0.2.45.1
Severity: normal
Followup-For: Bug #235068

Hi,

modconf should not require human intervention to unpack the kernel
source proided by a kernel-source package. The attached patch uses the
@sources array of available kernel sources to unpack them and test for
Makefile them starting with the last one. Hopefully the last one is
also the highest version.

You should also consider adding a 'real | virtual' Build-Depends for
kernel-source because apt-get build-dep fails without it and lintian
warns (in the next release). Maybe the soon to come kernel-tree or
kernel-tree-2.4|2.6 meta-package is a more suitable Build-Depends.

MfG
        Goswin

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.5-amd64
Locale: LANG=C, LC_CTYPE=de_DE

Versions of packages modconf depends on:
ii  modutils                      2.4.26-1   Linux module utilities
ii  whiptail [whiptail-provider]  0.51.4-23  Displays user-friendly dialog boxe

-- no debconf information
diff -Nurd modconf-0.2.45.1.deb/debian/changelog modconf-0.2.45.1/debian/changelog
--- modconf-0.2.45.1.deb/debian/changelog       2004-03-20 22:05:39.000000000 +0000
+++ modconf-0.2.45.1/debian/changelog   2004-06-22 00:33:06.000000000 +0000
@@ -1,3 +1,9 @@
+modconf (0.2.45.1-0.0.0.1.pure64) unstable; urgency=low
+
+  * Unpack kernel-source during build
+
+ -- Goswin von Brederlow <[EMAIL PROTECTED]>  Tue, 22 Jun 2004 02:23:32 +0200
+
 modconf (0.2.45.1) unstable; urgency=low
 
   * NMU
diff -Nurd modconf-0.2.45.1.deb/debian/mkkerneldesc.pl 
modconf-0.2.45.1/debian/mkkerneldesc.pl
--- modconf-0.2.45.1.deb/debian/mkkerneldesc.pl 2004-03-20 22:06:33.000000000 +0000
+++ modconf-0.2.45.1/debian/mkkerneldesc.pl     2004-06-22 00:51:58.000000000 +0000
@@ -9,19 +9,23 @@
 # Enable/Disable debugging here
 my $opt_d = 0;
 
+my @sources = glob ("/usr/src/kernel-source-*.tar.bz2");
+die "You need to install a kernel-source package!\n" if (scalar(@sources) == 0 );
+
 my $linux = '';
-my @linux = glob ("/usr/src/kernel-source-*/");
[EMAIL PROTECTED] = ("/usr/src/kernel-source/", "/usr/src/linux/", @linux);
-my $dir;
-foreach $dir (@linux) {
-  if (-f "${dir}Makefile") {
+my $file = '';
+mkdir("linux");
+foreach $file (reverse @sources) {
+  warn "I: Unpacking kernel source from \"".$file."\"\n";
+  system("tar -C linux -x --bzip -f ".$file);
+  my $dir = glob ("linux/kernel-source-*");
+  if (-f "${dir}/Makefile") {
     $linux = $dir;
     last;
   }
 }
-my @sources = glob ("/usr/src/kernel-source-*tar.{bz2,gz}");
-warn "E: You need to install a kernel-source package and unpack the tar it 
provides!\n" if ( $linux eq '' && scalar(@sources) > 0 ) ;
-die "Cannot find kernel source" if ($linux eq '');
+die "Unpacking kernel source failed" if ($linux eq '');
+
 warn "I: Will parse kernel Makefiles under \"$linux\".\n";
 if(open(fh, "<$linux/Makefile") && grep(/PATCHLEVEL.*=.*6/, <fh>)) {
    warn "I: Using Kernel 2.6 extraction method.\n";
diff -Nurd modconf-0.2.45.1.deb/debian/rules modconf-0.2.45.1/debian/rules
--- modconf-0.2.45.1.deb/debian/rules   2001-01-26 01:35:03.000000000 +0000
+++ modconf-0.2.45.1/debian/rules       2004-06-22 00:40:56.000000000 +0000
@@ -20,9 +20,10 @@
 clean:
        $(checkdir)
        -make clean
-       -rm -f `find . -name "*~"`
-       -rm -rf debian/tmp debian/files* core
-       -rm -f build-stamp
+       rm -f `find . -name "*~"`
+       rm -rf debian/tmp debian/files* core
+       rm -rf linux
+       rm -f build-stamp
 
 binary-indep:  checkroot build
        $(checkdir)

Reply via email to