- # 3 space indent lines the command being run up under the
- # sequence name after "dh ".
- print " ".escape_shell($command, @options)."\n";
+ # If some packages are excluded, add flags
+ # to prevent them from being acted on.
+ push @options, map { "-N$_" } @exclude;
+
+ # Check for override targets in debian/rules and
+ # run them instead of running the command directly.
+ my $override_command;
+ my $has_explicit_target = rules_explicit_target("override_".$command);
+ if (defined $has_explicit_target) {
+ $override_command=$command;
+ # Check if target isn't noop
+ if ($has_explicit_target) {
+ # This passes the options through to commands called
+ # inside the target.
+ $ENV{DH_INTERNAL_OPTIONS}=join("\x1e", @options);
+ $command="debian/rules";
+ @options="override_".$override_command;
+ }
+ else {
+ $command = undef;
+ }
+ }
+ else {
+ # Pass additional command options if any
+ unshift @options, @{$command_opts{$command}} if exists $command_opts{$command};
+ }
+
+ if (defined $command) {
+ # 3 space indent lines the command being run up under the
+ # sequence name after "dh ".
+ print " ".escape_shell($command, @options)."\n";
+ }
+ else {
+ print " ", "# Skipping ", $override_command, " - empty override", "\n";
+ }