Package: dpkg-dev
Version: 1.13.25
Severity: wishlist
Tags: patch

Attached patch adds support for parallel builds (dpkg-buildpackage -j N).

It is based on the one from bug #355654.

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)

Versions of packages dpkg-dev depends on:
ii  binutils                      2.17-3     The GNU assembler, linker and bina
ii  cpio                          2.6-17     GNU cpio -- a program to manage ar
ii  dpkg                          1.13.25    package maintenance system for Deb
ii  make                          3.81-3     The GNU version of the "make" util
ii  patch                         2.5.9-4    Apply a diff file to an original
ii  perl [perl5]                  5.8.8-7    Larry Wall's Practical Extraction 
ii  perl-modules                  5.8.8-7    Core Perl modules

Versions of packages dpkg-dev recommends:
ii  bcc [c-compiler]             0.16.14-1.4 16-bit x86 C compiler
ii  bzip2                        1.0.3-6     high-quality block-sorting file co
ii  gcc [c-compiler]             4:4.1.1-15  The GNU C compiler
ii  gcc-3.4 [c-compiler]         3.4.6-5     The GNU C compiler
ii  gcc-4.0 [c-compiler]         4.0.3-7     The GNU C compiler
ii  gcc-4.1 [c-compiler]         4.1.1-21    The GNU C compiler

-- no debconf information
diff -ur dpkg-1.14.5.old/scripts/dpkg-buildpackage.sh 
dpkg-1.14.5/scripts/dpkg-buildpackage.sh
--- dpkg-1.14.5.old/scripts/dpkg-buildpackage.sh        2007-06-19 
14:11:37.000000000 +0200
+++ dpkg-1.14.5/scripts/dpkg-buildpackage.sh    2007-09-03 12:20:25.000000000 
+0200
@@ -23,6 +23,7 @@
 Options:
   -r<gain-root-command>
   -p<sign-command>
+  -j<N>          allow N jobs at once.
   -d             do not check build dependencies and conflicts.
   -D             check build dependencies and conflicts.
   -k<keyid>      the key to use for signing.
@@ -59,6 +60,7 @@
 }
 
 rootcommand=''
+makecommand='make'
 signcommand=""
 if [ -e "$GNUPGHOME" ] || [ -e "$HOME/.gnupg" ] && \
                command -v gpg > /dev/null 2>&1; then
@@ -96,6 +98,7 @@
                admindir="$value" ;;
        -r*)    rootcommand="$value" ;;
        -p*)    signcommand="$value" ;;
+       -j*)    makecommand="$makecommand -j $value" ;;
        -k*)    signkey="$value" ;;
        -d)     checkbuilddep=false ;;
        -D)     checkbuilddep=true ;;
@@ -220,14 +223,14 @@
 if [ -n "$desc"                ]; then set -- "$@" "-C$desc"           ; fi
 
 if [ x$noclean != xtrue ]; then
-       withecho $rootcommand debian/rules clean
+       withecho $rootcommand $makecommand -f debian/rules clean
 fi
 if [ x$binaryonly = x ]; then
        cd ..; withecho dpkg-source $passopts $diffignore $tarignore -b 
"$dirn"; cd "$dirn"
 fi
 if [ x$sourceonly = x ]; then
-       withecho debian/rules build 
-       withecho $rootcommand debian/rules $binarytarget
+       withecho $makecommand -f debian/rules build 
+       withecho $rootcommand $makecommand -f debian/rules $binarytarget
 fi
 if [ "$usepause" = "true" ] && \
    ( [ "$signchanges" != ":" ] || ( [ -z "$binaryonly" ] && [ "$signsource" != 
":" ] ) ) ; then
@@ -281,7 +284,7 @@
 fi
 
 if $cleansource; then
-       withecho $rootcommand debian/rules clean
+       withecho $rootcommand $makecommand -f debian/rules clean
 fi
 
 echo "dpkg-buildpackage: $srcmsg"

Reply via email to