chiark / gitweb /
Provide -wdd aka --clean=dpkg-source-d. Closes:#792433.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 079e5dec7c212c0c4ea1be9ecb76f4891af75cfb..47c55f3905217dd0b25eb0490608889132ca6c22 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2633,6 +2633,8 @@ sub quilt_fixup_editor () {
 sub clean_tree () {
     if ($cleanmode eq 'dpkg-source') {
        runcmd_ordryrun_local @dpkgbuildpackage, qw(-T clean);
+    } elsif ($cleanmode eq 'dpkg-source-d') {
+       runcmd_ordryrun_local @dpkgbuildpackage, qw(-d -T clean);
     } elsif ($cleanmode eq 'git') {
        runcmd_ordryrun_local @git, qw(clean -xdf);
     } elsif ($cleanmode eq 'git-ff') {
@@ -2731,6 +2733,9 @@ sub build_source {
     if ($cleanmode eq 'dpkg-source') {
        runcmd_ordryrun_local (@dpkgbuildpackage, qw(-us -uc -S)),
            changesopts();
+    } elsif ($cleanmode eq 'dpkg-source-d') {
+       runcmd_ordryrun_local (@dpkgbuildpackage, qw(-us -uc -S -d)),
+           changesopts();
     } else {
        my $pwd = must_getcwd();
        my $leafdir = basename $pwd;
@@ -2873,7 +2878,7 @@ sub parseopts () {
            } elsif (m/^--build-products-dir=(.*)/s) {
                push @ropts, $_;
                $buildproductsdir = $1;
-           } elsif (m/^--clean=(dpkg-source|git|git-ff|none)$/s) {
+           } elsif (m/^--clean=(dpkg-source(?:-d)?|git|git-ff|none)$/s) {
                push @ropts, $_;
                $cleanmode = $1;
            } elsif (m/^--clean=(.*)$/s) {
@@ -2951,6 +2956,9 @@ sub parseopts () {
                } elsif (s/^-wd$//s) {
                    push @ropts, $&;
                    $cleanmode = 'dpkg-source';
+               } elsif (s/^-wdd$//s) {
+                   push @ropts, $&;
+                   $cleanmode = 'dpkg-source-d';
                } else {
                    badusage "unknown short option \`$_'";
                }