]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh
logic simplification
[debhelper.git] / dh
diff --git a/dh b/dh
index a233db4a8ef44369ffd521b177e5ce2d775d4256..775e94921d90b64a39d89f391fcaf2a6f18b7aeb 100755 (executable)
--- a/dh
+++ b/dh
@@ -234,19 +234,14 @@ init(options => {
 });
 inhibit_log();
 
-# Parallel defaults to "unset" unless unavailable --jobserver-fds is detected
-# in MAKEFLAGS. This typically means dpkg-buildpackage was called with a -jX
-# option. Then -jX in MAKEFLAGS gets "consumed" by make invocation of
-# debian/rules and "converted" to --jobserver-fds.  If jobserver is
-# unavailable, dh was probably called via debian/rules without "+" prefix (so
-# make has closed jobserver FDs). In such a case, MAKEFLAGS is cleaned from the
-# offending --jobserver-fds option in order to prevent further make invocations
-# from spitting warnings and disabling job support.
+# If make was using a jobserver, but it is not available, clean out
+# MAKEFLAGS so that further make invocations can start a new job
+# server. 
 if (is_make_jobserver_unavailable()) {
-       clean_makeflags();
-       # Enable parallel (no maximum) if the package doesn't since it appears this
-       # dh is called via dpkg-buildpackage -jX.
-       $dh{PARALLEL} = 0 if !defined $dh{PARALLEL};
+       clean_jobserver_makeflags();
+       # Implicitly enable parallel (no maximum) if a value was not previously
+       # specified.
+       $dh{PARALLEL} = 0 unless defined $dh{PARALLEL};
 }
 
 # Definitions of sequences.
@@ -541,8 +536,8 @@ sub run {
        # to prevent them from being acted on.
        push @options, map { "-N$_" } @exclude;
 
-       # Pass --parallel to dh_auto_* commands if requested
-       if (defined $dh{PARALLEL} && ($dh{PARALLEL} == 0 || $dh{PARALLEL} > 1)
+       # Pass --parallel to dh_auto_* commands.
+       if (defined $dh{PARALLEL} && $dh{PARALLEL} != 1
            && $command =~ /^dh_auto_/) {
                push @options, "--parallel" . ($dh{PARALLEL} > 1 ? "=$dh{PARALLEL}" : "");
        }