chiark / gitweb /
Break out $cleanmode_re (nfc)
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 21cbd56f67d26cc1cd8ab11052461f4c37d6ef5c..d7d27f834c4c9d349ceb2e78553c2852a239464b 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -67,6 +67,7 @@ our $initiator_tempdir;
 our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
 
 our $suite_re = '[-+.0-9a-z]+';
+our $cleanmode_re = 'dpkg-source(?:-d)?|git|git-ff|check|none';
 
 our (@git) = qw(git);
 our (@dget) = qw(dget);
@@ -2973,9 +2974,15 @@ sub cmd_build {
 sub cmd_gbp_build {
     my @dbp = @dpkgbuildpackage;
     massage_dbp_args \@dbp, \@ARGV;
-    my @cmd =
-       (qw(git-buildpackage -us -uc --git-no-sign-tags),
-        "--git-builder=@dbp");
+
+    my @cmd;
+    if (length executable_on_path('git-buildpackage')) {
+       @cmd = qw(git-buildpackage);
+    } else {
+       @cmd = qw(gbp buildpackage);
+    }
+    push @cmd, (qw(-us -uc --git-no-sign-tags), "--git-builder=@dbp");
+
     if ($cleanmode eq 'dpkg-source') {
        $suppress_clean = 1;
     } else {
@@ -3158,7 +3165,7 @@ sub parseopts () {
            } elsif (m/^--build-products-dir=(.*)/s) {
                push @ropts, $_;
                $buildproductsdir = $1;
-           } elsif (m/^--clean=(dpkg-source(?:-d)?|git|git-ff|check|none)$/s) {
+           } elsif (m/^--clean=($cleanmode_re)$/os) {
                push @ropts, $_;
                $cleanmode = $1;
            } elsif (m/^--clean=(.*)$/s) {