Sfoglia il codice sorgente

dpkg-buildpackage: Enable -Jauto by default

The Debian build daemons have already been enabling parallel builds for
a some time now. This has the advantage that it should make the builds
faster, and that it gives similar conditions to local builders to the
ones on build daemon networks, helping to catch problems with parallel
build support in packages before the upload.

Closes: #842845
Suggested-by: Simon McVittie <smcv@debian.org>
Guillem Jover 9 anni fa
parent
commit
1e3658185c
3 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 1 0
      debian/changelog
  2. 2 0
      man/dpkg-buildpackage.man
  3. 7 2
      scripts/dpkg-buildpackage.pl

+ 1 - 0
debian/changelog

@@ -66,6 +66,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     - Add new dpkg-genbuildinfo command.
     - Hook it into the dpkg-buildpackage machinery.
     Based on a patch by Jérémy Bobbio <lunar@debian.org>. Closes: #138409
+  * Enable dpkg-buildpackage -Jauto by default. Closes: #842845
   * Architecture support:
     - Add support for AIX operating system.
     - Add a version pseudo-field to the arch tables.

+ 2 - 0
man/dpkg-buildpackage.man

@@ -253,6 +253,8 @@ This option (since dpkg 1.18.2, long option since dpkg 1.18.8) is equivalent
 to the \fB\-j\fP option except that it does not set the \fBMAKEFLAGS\fP
 environment variable, and as such it is safer to use with any package
 including those that are not parallel-build safe.
+
+\fBauto\fP is the default behavior (since dpkg 1.18.11).
 .TP
 .BR \-D ", " \-\-check\-builddeps
 Check build dependencies and conflicts; abort if unsatisfied (long option

+ 7 - 2
scripts/dpkg-buildpackage.pl

@@ -86,7 +86,7 @@ sub usage {
                                 forced mode.
   -J, --jobs-try[=<number>|auto]
                               jobs to run simultaneously (passed to <rules>),
-                                opt-in mode.
+                                opt-in mode (default is auto).
   -r, --root-command=<command>
                               command to gain root rights (default is fakeroot).
       --check-command=<command>
@@ -147,7 +147,7 @@ my $signcommand;
 my $noclean;
 my $cleansource;
 my $parallel;
-my $parallel_force;
+my $parallel_force = 0;
 my $checkbuilddep = 1;
 my $check_builtin_builddep = 1;
 my @source_opts;
@@ -383,6 +383,11 @@ if ($signcommand) {
     }
 }
 
+# Default to auto if none of parallel=N, -J or -j have been specified.
+if (not defined $parallel and not $build_opts->has('parallel')) {
+    $parallel = 'auto';
+}
+
 if (defined $parallel) {
     if ($parallel eq 'auto') {
         # Most Unices.