Explorar o código

dpkg-buildpackage: fix value of "parallel" exported in DEB_BUILD_OPTIONS

When "-j" is given, it used to export "parallel=-1" instead of the more
logical "parallel=" that gives the desired result with the sample make
invocation shown in the Debian policy:
  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  MAKEFLAGS += -j$(NUMJOBS)
Raphaël Hertzog %!s(int64=16) %!d(string=hai) anos
pai
achega
5e4c14712a
Modificáronse 2 ficheiros con 5 adicións e 7 borrados
  1. 2 0
      debian/changelog
  2. 3 7
      scripts/dpkg-buildpackage.pl

+ 2 - 0
debian/changelog

@@ -4,6 +4,8 @@ dpkg (1.15.5.6) UNRELEASED; urgency=low
     created before trying to register a new patch in .pc/applied-patches.
     Thanks to Tommi Vainikainen <thv+debian@iki.fi> for the report and the
     patch. Closes: #561237
+  * Fix dpkg-buildpackage to set "parallel=" in DEB_BUILD_OPTIONS instead of
+    the invalid "parallel=-1" when option "-j" is given. Closes: #562038
 
  -- Raphael Hertzog <hertzog@debian.org>  Wed, 23 Dec 2009 17:05:43 +0100
 

+ 3 - 7
scripts/dpkg-buildpackage.pl

@@ -134,7 +134,7 @@ while (@ARGV) {
     } elsif (/^--admindir=(.*)$/) {
 	$admindir = $1;
     } elsif (/^-j(\d*)$/) {
-	$parallel = $1 || '-1';
+	$parallel = $1 || '';
     } elsif (/^-r(.*)$/) {
 	@rootcommand = split /\s+/, $1;
     } elsif (/^-p(.*)$/) {
@@ -256,14 +256,10 @@ if ($signcommand) {
 }
 
 my $build_opts = Dpkg::BuildOptions::parse();
-if ($parallel) {
+if (defined $parallel) {
     $parallel = $build_opts->{parallel} if exists $build_opts->{parallel};
     $ENV{MAKEFLAGS} ||= '';
-    if ($parallel eq '-1') {
-	$ENV{MAKEFLAGS} .= " -j";
-    } else {
-	$ENV{MAKEFLAGS} .= " -j$parallel";
-    }
+    $ENV{MAKEFLAGS} .= " -j$parallel";
     $build_opts->{parallel} = $parallel;
     Dpkg::BuildOptions::set($build_opts);
 }