]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh
Make dh not complain about unknown, command-specific options passed to it
[debhelper.git] / dh
diff --git a/dh b/dh
index 701f588e643378c4a0097a1a5e6ee5238389786b..4ea69b25a6fb025ee990e72db56336c1a5b5752b 100755 (executable)
--- a/dh
+++ b/dh
@@ -179,6 +179,16 @@ sequence addons like this:
        %:
                dh --with quilt $@
 
+Here is an example of overriding where the dh_auto_* commands find
+the package's source, for a package where the source is located in a
+subdirectory. It also forces use of perl's Module::Build build system,
+which can be necessary if debhelper wrongly detects that the package
+uses MakeMaker.
+
+       #!/usr/bin/make -f
+       %:
+               dh --sourcedirectory=src --buildsystem=perl_build $@
+
 =cut
 
 # Stash this away before init modifies it.
@@ -187,6 +197,11 @@ my @ARGV_orig=@ARGV;
 # python-support is enabled by default, at least for now
 # (and comes first so python-central loads later and can disable it).
 unshift @ARGV, "--with=python-support";
+               
+# Disable complaints about unknown options for both dh and the commands
+# it runs. This is done because dh accepts and passes on options that may
+# be specific to only some debhelper commands.
+$ENV{DH_IGNORE_UNKNOWN_OPTIONS}=1;
 
 init(options => {
        "until=s" => \$dh{UNTIL},
@@ -252,7 +267,6 @@ $sequences{install} = [@{$sequences{build}}, qw{
        dh_gconf
        dh_icons
        dh_perl
-       dh_scrollkeeper
        dh_usrlocal
 
        dh_link
@@ -471,9 +485,13 @@ sub run {
                        # Need to handle logging for overriden commands here,
                        # because the actual debhelper command may not have
                        # been run by the rules file target.
-                       my %packages=map { $_ => 1 } @packages;
-                       map { delete $packages{$_} } @exclude;
-                       write_log($override_command, keys %packages);
+                       # (But avoid logging for dh_clean since it removes
+                       # the log earlier.)
+                       if ($override_command ne 'dh_clean') {
+                               my %packages=map { $_ => 1 } @packages;
+                               map { delete $packages{$_} } @exclude;
+                               write_log($override_command, keys %packages);
+                       }
                }
        }
 }