path: root/dh
diff options
authorJoey Hess <>2009-10-28 16:45:12 -0400
committerJoey Hess <>2009-10-28 17:02:41 -0400
commit76719d85abaa3a536af862b0aac2307d735e84d8 (patch)
tree130293bc255d0fd6840bb7c9e8d39cb5def2d6db /dh
parent4fb1f3b2d64a2faa9d961205b1c32f83028172c8 (diff)
split get_make_jobserver_status into two functions
I disliked the complexity of the return values, and the boilerplate code that followed the two calls to the function, to clean/unset MAKEFLAGS. To solve both, I refactored it into two functions, one simply tests to see if a jobserver is specified but unavailable, while the other cleans/unsets MAKEFLAGS. This loses the ability to pull the jobs-N count out of MAKEFLAGS, but that was not currently used.
Diffstat (limited to 'dh')
1 files changed, 2 insertions, 9 deletions
diff --git a/dh b/dh
index 9d1fca0..a233db4 100755
--- a/dh
+++ b/dh
@@ -242,15 +242,8 @@ inhibit_log();
# 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.
-my ($status, $makeflags) = get_make_jobserver_status();
-if ($status eq "jobserver-unavailable") {
- # Stop make from spitting pointless job control warnings
- if (defined $makeflags) {
- $ENV{MAKEFLAGS} = $makeflags;
- }
- else {
- delete $ENV{MAKEFLAGS};
- }
+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};