]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh
remove implicit --parallel setting by dh
[debhelper.git] / dh
diff --git a/dh b/dh
index 2e7385f4ec7f286bd197c53bc388087a899fc5dd..0ecfe442d5a9f5cbb4f0950c5ed30494fa677b78 100755 (executable)
--- a/dh
+++ b/dh
@@ -8,7 +8,6 @@ dh - debhelper command sequencer
 
 use strict;
 use Debian::Debhelper::Dh_Lib;
-use File::Spec;
 
 =head1 SYNOPSIS
 
@@ -226,6 +225,13 @@ init(options => {
 });
 inhibit_log();
 
+# 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_jobserver_makeflags();
+}
+
 # Definitions of sequences.
 my %sequences;
 $sequences{build} = [qw{
@@ -254,7 +260,6 @@ $sequences{install} = [@{$sequences{build}}, qw{
        dh_installcatalogs
        dh_installcron
        dh_installdebconf
-       dh_installcatalogs
        dh_installemacsen
        dh_installifupdown
        dh_installinfo
@@ -294,6 +299,9 @@ $sequences{binary} = [@{$sequences{install}}, qw{
 }, @b];
 $sequences{'binary-arch'} = [@{$sequences{binary}}];
 
+# Additional command options
+my %command_opts;
+
 # sequence addon interface
 sub _insert {
        my $offset=shift;
@@ -334,11 +342,32 @@ sub add_command {
        my $sequence=shift;
        unshift @{$sequences{$sequence}}, $command;
 }
+sub add_command_options {
+       my $command=shift;
+       push @{$command_opts{$command}}, @_;
+}
+sub remove_command_options {
+       my $command=shift;
+       if (@_) {
+               # Remove only specified options
+               if (my $opts = $command_opts{$command}) {
+                       foreach my $opt (@_) {
+                               $opts = [ grep { $_ ne $opt } @$opts ];
+                       }
+                       $command_opts{$command} = $opts;
+               }
+       }
+       else {
+               # Clear all additional options
+               delete $command_opts{$command};
+       }
+}
 
 if ($dh{LIST}) {
        my %addons;
 
        for my $inc (@INC) {
+               eval q{use File::Spec};
                my $path = File::Spec->catdir($inc, "Debian/Debhelper/Sequence");
                if (-d $path) {
                        for my $module_path (glob "$path/*.pm") {
@@ -362,7 +391,7 @@ foreach my $addon (@{$dh{WITH}}) {
        $mod=~s/-/_/g;
        eval "use $mod";
        if ($@) {
-               error("--with $addon not supported or failed to load module $mod");
+               error("unable to load addon $addon: $@");
        }
 }
 
@@ -501,6 +530,10 @@ sub run {
                $command="debian/rules";
                @options="override_".$override_command;
        }
+       else {
+               # Pass additional command options if any
+               unshift @options, @{$command_opts{$command}} if exists $command_opts{$command};
+       }
 
        # 3 space indent lines the command being run up under the 
        # sequence name after "dh ".