path: root/dh
diff options
authorJoey Hess <>2009-10-28 17:23:28 -0400
committerJoey Hess <>2009-10-28 17:31:01 -0400
commit2ec1c8af7f5216b574a93240e2a68a896b0896c1 (patch)
treefa4089d38ff270035d797b63d7241406c4e02f9b /dh
parent76719d85abaa3a536af862b0aac2307d735e84d8 (diff)
reduce amount of MAKEFLAGS cleaning
Now clean_jobserver_makeflags will only remove --jobserver settings from MAKEFLAGS. This is simpler and easier to understand than the old behavior, which, if there was no --jobserver, removed all -j and --jobs, while leaving those when removing --jobserver. This relies on -j options passed to make overriding -j settings in MAKEFLAGS. So we don't need to clean those out, we can just override them.
Diffstat (limited to 'dh')
1 files changed, 6 insertions, 11 deletions
diff --git a/dh b/dh
index a233db4..8e781b6 100755
--- a/dh
+++ b/dh
@@ -234,18 +234,13 @@ init(options => {
-# 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.
+ clean_jobserver_makeflags();
+ # Enable parallel (no maximum) if a value was not previously
+ # specified.
$dh{PARALLEL} = 0 if !defined $dh{PARALLEL};