summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Buildsystem
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-10-28 16:45:12 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-10-28 17:02:41 -0400
commit76719d85abaa3a536af862b0aac2307d735e84d8 (patch)
tree130293bc255d0fd6840bb7c9e8d39cb5def2d6db /Debian/Debhelper/Buildsystem
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 'Debian/Debhelper/Buildsystem')
-rw-r--r--Debian/Debhelper/Buildsystem/makefile.pm13
1 files changed, 4 insertions, 9 deletions
diff --git a/Debian/Debhelper/Buildsystem/makefile.pm b/Debian/Debhelper/Buildsystem/makefile.pm
index f21b2cb..159f7c1 100644
--- a/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/Debian/Debhelper/Buildsystem/makefile.pm
@@ -7,7 +7,8 @@
package Debian::Debhelper::Buildsystem::makefile;
use strict;
-use Debian::Debhelper::Dh_Lib qw(escape_shell get_make_jobserver_status);
+use Debian::Debhelper::Dh_Lib qw(escape_shell is_make_jobserver_unavailable
+ clean_makeflags);
use base 'Debian::Debhelper::Buildsystem';
sub get_makecmd_C {
@@ -37,14 +38,8 @@ sub do_make {
# Always clean MAKEFLAGS from unavailable jobserver options. If parallel
# is enabled, do more extensive clean up from all job control specific
# options
- my ($status, $makeflags) = get_make_jobserver_status();
- if ($status eq "jobserver-unavailable" || defined $this->get_parallel()) {
- if (defined $makeflags) {
- $ENV{MAKEFLAGS} = $makeflags;
- }
- else {
- delete $ENV{MAKEFLAGS} if exists $ENV{MAKEFLAGS};
- }
+ if (defined $this->get_parallel() || is_make_jobserver_unavailable()) {
+ clean_makeflags();
}
# Start a new jobserver if parallel building was requested