]> git.donarmstrong.com Git - debhelper.git/commitdiff
dh: Add --without to allow disabling sequence addons (particularly useful to disable...
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 4 May 2009 18:46:50 +0000 (14:46 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 4 May 2009 18:46:50 +0000 (14:46 -0400)
debian/changelog
dh

index 9b9444081f635fb74e81a356b0a6a64cca2b9f88..34eae09c27ec85fb5fc588de3be933ff83ed3270 100644 (file)
@@ -3,6 +3,8 @@ debhelper (7.2.9) UNRELEASED; urgency=low
   * dh_fixperms: Ensure lintian overrides are mode 644.
     (Patch from #459548)
   * dh_fixperms: Fix permissions of OCaml .cmxs files. Closes: #526221
+  * dh: Add --without to allow disabling sequence addons (particularly
+    useful to disable the default python-support addon).
 
  -- Joey Hess <joeyh@debian.org>  Tue, 21 Apr 2009 17:01:41 -0400
 
diff --git a/dh b/dh
index 2a91b92d7af29d34de874baf57a62753aad37451..427a1c9dc2230e4d118302de4d4b55ab15a8b5b2 100755 (executable)
--- a/dh
+++ b/dh
@@ -53,6 +53,10 @@ than once, and is used when there is a third-party package that provides
 debhelper commands. See the PROGRAMMING file for documentation about
 the sequence addon interface.
 
+=item B<--without> I<addon>
+
+The inverse of --with, disables using the given addon.
+
 =item B<--until> I<cmd>
 
 Run commands in the sequence until and including I<cmd>, then stop.
@@ -172,6 +176,10 @@ default. This is how to use dh_pycentral instead.
 # Stash this away before init modifies it.
 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";
+
 init(options => {
        "until=s" => \$dh{UNTIL},
        "after=s" => \$dh{AFTER},
@@ -181,6 +189,10 @@ init(options => {
                my ($option,$value)=@_;
                push @{$dh{WITH}},$value;
        },
+       "without=s" => sub {
+               my ($option,$value)=@_;
+               @{$dh{WITH}} = grep { $_ ne $value } @{$dh{WITH}};
+       },
 });
 inhibit_log();
 
@@ -253,9 +265,6 @@ $sequences{binary} = [@{$sequences{install}}, qw{
 }, @b];
 $sequences{'binary-arch'} = [@{$sequences{binary}}];
 
-# --with python-support is enabled by default, at least for now
-unshift @{$dh{WITH}}, "python-support";
-
 # sequence addon interface
 sub _insert {
        my $offset=shift;
@@ -339,11 +348,11 @@ elsif ($sequence eq 'binary-indep') {
 while (@ARGV_orig) {
        my $opt=shift @ARGV_orig;
        next if $opt eq $sequence;
-       if ($opt =~ /^--?(after|until|before|with)$/) {
+       if ($opt =~ /^--?(after|until|before|with|without)$/) {
                shift @ARGV_orig;
                next;
        }
-       elsif ($opt =~ /^--?(no-act|remaining|(after|until|before|with)=)/) {
+       elsif ($opt =~ /^--?(no-act|remaining|(after|until|before|with|without)=)/) {
                next;
        }
        push @options, $opt;