Package: kernel-package
Version: 12.032
Severity: wishlist
Tags: patch

Could a '-j' flag please be accepted into the make-kpkg script to bring it's behavior into line with it's close relative-by-name make? I've been compiling a couple of kernels recently to test exciting new stuff, and I'm getting really sick of the typing 'CONCURRENCY_LEVEL=3 fakeroot make-kpkg' before I even get to the interesting options. A -j is easier on both my shift key and my poor speeling of concurency.

This patch adds (examples) --jobs 3, -j 4, -j6 as valid arguments, by setting CONCURRENCY_LEVEL in make-kpkg.

-- System Information:
Debian Release: squeeze/sid
 APT prefers unstable
 APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.33-rc8 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages kernel-package depends on:
ii binutils 2.20-6 The GNU assembler, linker and bina ii build-essential 11.4 Informational list of build-essent ii debianutils 3.2.2 Miscellaneous utilities specific t ii file 5.04-1 Determines file type using "magic" ii gettext 0.17-8 GNU Internationalization utilities ii make 3.81-7 An utility for Directing compilati ii module-init-tools 3.12~pre1-1 tools for managing Linux kernel mo ii po-debconf 1.0.16 tool for managing templates file t
ii  util-linux                   2.16.2-0    Miscellaneous system utilities

Versions of packages kernel-package recommends:
ii cpio 2.10-1 GNU cpio -- a program to manage ar

Versions of packages kernel-package suggests:
pn  btrfs-tools      <none>                  (no description available)
ii bzip2 1.0.5-4 high-quality block-sorting file co
pn  docbook-utils    <none>                  (no description available)
ii e2fsprogs 1.41.10-1 ext2/ext3/ext4 file system utiliti ii grub 0.97-59 GRand Unified Bootloader (dummy pa ii initramfs-tools 0.93.4 tools for generating an initramfs
pn  jfsutils         <none>                  (no description available)
ii libncurses5-dev 5.7+20090803-2 developer's libraries and docs for ii linux-source-2.6 2.6.33-rc6-10.00.Custom Linux kernel source for version 2.
pn  mcelog           <none>                  (no description available)
pn  oprofile         <none>                  (no description available)
pn  pcmciautils      <none>                  (no description available)
pn  ppp              <none>                  (no description available)
ii  procps           1:3.2.8-7               /proc file system utilities
pn  quota            <none>                  (no description available)
pn  reiserfsprogs    <none>                  (no description available)
pn  squashfs-tools   <none>                  (no description available)
ii udev 150-2 /dev/ and hotplug management daemo
pn  xfsprogs         <none>                  (no description available)
pn  xmlto            <none>                  (no description available)

-- no debconf information

diff -c kernel-package-12.032//make-kpkg kernel-package-patch//make-kpkg
*** kernel-package-12.032//make-kpkg	2009-08-13 02:14:37.000000000 +1000
--- kernel-package-patch//make-kpkg	2010-02-14 07:56:13.000000000 +1100
***************
*** 37,42 ****
--- 37,43 ----
  my $arch='';
  my $arch_in_name=0;
  my $bzimage;
+ my $concurrency=0;
  my $config_target='oldconfig';
  my $cross_compile='';
  my $key_id='';
***************
*** 84,90 ****
     "us"                  => \$unsign_source,
     "uc"                  => \$unsign_changelog,
     "bzimage"             => \$bzimage,
!    "mkimage=s"           => \$mkimage
    );
  
  =head1 SYNOPSIS
--- 85,92 ----
     "us"                  => \$unsign_source,
     "uc"                  => \$unsign_changelog,
     "bzimage"             => \$bzimage,
!    "mkimage=s"           => \$mkimage,
!    "jobs|j=i"            => \$concurrency
    );
  
  =head1 SYNOPSIS
***************
*** 278,283 ****
--- 280,287 ----
  
  =back
  
+ =item B<-j> -I<jobs>, B<--jobs> -I<jobs> Set CONCURRENCY_LEVEL=-I<jobs>
+ 
  =item B<--overlay-dir> /path/to/directory
  
  =over 2
***************
*** 385,390 ****
--- 389,396 ----
   --arch_in_name        Embed the subarch in the image package name
   --stem     foo        Call the packages foo-* instead of kernel-*
   --initrd              Create a image package suitable for initrd.
+  -j         jobs       Sec CONCURRENCY_LEVEL to -I<jobs> for this action.
+  --jobs     jobs       Set CONCURRENCY_LEVEL to -I<jobs> for this action.
   --pgpsign  name       An ID used to sign the changes file using pgp.
   --config target       Change the type of configure done from the  default
                         oldconfig.
***************
*** 666,671 ****
--- 672,678 ----
    $rules_file = "debian/rules";
    $alt_rules_file = "/usr/share/kernel-package/ruleset/minimal.mk";
  
+   Getopt::Long::Configure("bundling");
    $ret = GetOptions(%option_ctl);
    if(!$ret) {
          print "use --help to display command line syntax help.\n" ;
***************
*** 695,708 ****
        ($ENV{'MAKEFLAGS'} =~ /-j/ || $ENV{'MAKEFLAGS'} =~ /--jobs/ )) {
      $errors .= "The environment variable MAKEFLAGS contains the flag -j.\n" .
        "Unfortunately, this is not supported at this time. Instead, please\n" .
!         "use the supported mechanism by setting CONCURRENCY_LEVEL\n" ;
    }
  
    if ($ENV{'MFLAGS'} &&
        ($ENV{'MFLAGS'} =~ /-j/ || $ENV{'MFLAGS'} =~ /--jobs/ )) {
      $errors .= "The environment variable MFLAGS contains the flag -j.\n" .
        "Unfortunately, this is not supported at this time. Instead, please\n" .
!         "use the supported mechanism by setting CONCURRENCY_LEVEL\n" ;
    }
  
    if ($root_cmd || $unsign_source || $unsign_changelog){
--- 702,721 ----
        ($ENV{'MAKEFLAGS'} =~ /-j/ || $ENV{'MAKEFLAGS'} =~ /--jobs/ )) {
      $errors .= "The environment variable MAKEFLAGS contains the flag -j.\n" .
        "Unfortunately, this is not supported at this time. Instead, please\n" .
!         "use the supported mechanism by setting CONCURRENCY_LEVEL, or the -j flag" .
!         "of" . $main::MYNAME . "\n" ;
    }
  
    if ($ENV{'MFLAGS'} &&
        ($ENV{'MFLAGS'} =~ /-j/ || $ENV{'MFLAGS'} =~ /--jobs/ )) {
      $errors .= "The environment variable MFLAGS contains the flag -j.\n" .
        "Unfortunately, this is not supported at this time. Instead, please\n" .
!         "use the supported mechanism by setting CONCURRENCY_LEVEL, or the -j flag" .
!         "of" . $main::MYNAME . "\n" ;
!   }
! 
!   if($concurrency > 0){
!       $ENV{'CONCURRENCY_LEVEL'} = $concurrency;
    }
  
    if ($root_cmd || $unsign_source || $unsign_changelog){
diff -c kernel-package-12.032//make-kpkg.8 kernel-package-patch//make-kpkg.8
*** kernel-package-12.032//make-kpkg.8	2009-10-29 13:59:43.000000000 +1100
--- kernel-package-patch//make-kpkg.8	2010-02-14 08:04:18.000000000 +1100
***************
*** 80,86 ****
  .PP
  .B WARNING: 
  Do NOT set the \-j option in MAKEFLAGS directly, this shall cause the
! build to fail. Use CONCURRENCY_LEVEL as specified below.
  .SH OPTIONS
  .B \-\-help
  Print out a usage message.
--- 80,87 ----
  .PP
  .B WARNING: 
  Do NOT set the \-j option in MAKEFLAGS directly, this shall cause the
! build to fail. Use CONCURRENCY_LEVEL as specified below. There is
! also a -j flag that can be used.
  .SH OPTIONS
  .B \-\-help
  Print out a usage message.
***************
*** 261,266 ****
--- 262,271 ----
  no initrd will be created (the bundled in example scripts are
  just examples -- user action is required before anything happens).
  .TP
+ .B \-\-jobs " number"
+ .B \-j " number"
+ Set the environment variable CONCURRENCY_LEVEL to "number".
+ .TP
  .B \-\-overlay\-dir "/path/to/directory"
  The specified directory should contain files that will be placed in
  the 
***************
*** 356,362 ****
   "grep \-c '^processor' /proc/cpuinfo"
  .B WARNING: 
  Do NOT set the \-j option in MAKEFLAGS directly, this shall call the
! build to fail. 
  .SH TARGETS
  .TP
  .B clean
--- 361,367 ----
   "grep \-c '^processor' /proc/cpuinfo"
  .B WARNING: 
  Do NOT set the \-j option in MAKEFLAGS directly, this shall call the
! build to fail. It is possible to set \-j as a make-kpkg argument.
  .SH TARGETS
  .TP
  .B clean

Reply via email to