summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-10-28 17:23:28 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-10-28 17:31:01 -0400
commit2ec1c8af7f5216b574a93240e2a68a896b0896c1 (patch)
treefa4089d38ff270035d797b63d7241406c4e02f9b /Debian/Debhelper/Dh_Lib.pm
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 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index ac0d8ab..8af365f 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -16,7 +16,8 @@ use vars qw(@ISA @EXPORT %dh);
&compat &addsubstvar &delsubstvar &excludefile &package_arch
&is_udeb &udeb_filename &debhelper_script_subst &escape_shell
&inhibit_log &load_log &write_log &dpkg_architecture_value
- &sourcepackage &is_make_jobserver_unavailable &clean_makeflags);
+ &sourcepackage
+ &is_make_jobserver_unavailable &clean_jobserver_makeflags);
my $max_compat=7;
@@ -811,16 +812,13 @@ sub is_make_jobserver_unavailable {
return; # no jobserver specified
}
-# Cleans out job control options from MAKEFLAGS.
-sub clean_makeflags {
+# Cleans out jobserver options from MAKEFLAGS.
+sub clean_jobserver_makeflags {
if (exists $ENV{MAKEFLAGS}) {
if ($ENV{MAKEFLAGS} =~ /(?:^|\s)--jobserver-fds=(\d+)/) {
$ENV{MAKEFLAGS} =~ s/(?:^|\s)--jobserver-fds=\S+//g;
$ENV{MAKEFLAGS} =~ s/(?:^|\s)-j\b//g;
}
- else {
- $ENV{MAKEFLAGS} =~ s/(?:^|\s)(?:(?:-j\s*|--jobs(?:=|\s+))(\d+)?|--jobs)\b//g;
- }
delete $ENV{MAKEFLAGS} if $ENV{MAKEFLAGS} =~ /^\s*$/;
}
}