chiark / gitweb /
fix madison thing
[dgit.git] / dgit
diff --git a/dgit b/dgit
index d4a091056331d2041e4a566d0f85e8b5fffb5a8f..e4b1177dc23896b2389030e70e7a5a6bca0c2890 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -33,6 +33,7 @@ our $sign = 1;
 our $dryrun = 0;
 our $changesfile;
 our $new_package = 0;
 our $dryrun = 0;
 our $changesfile;
 our $new_package = 0;
+our $existing_package = 'dpkg';
 
 our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
 
 
 our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
 
@@ -208,7 +209,7 @@ sub parsechangelog {
     return $c;
 }
 
     return $c;
 }
 
-our $rmad;
+our %rmad;
 
 sub archive_query () {
     my $query = access_cfg('archive-query');
 
 sub archive_query () {
     my $query = access_cfg('archive-query');
@@ -217,13 +218,15 @@ sub archive_query () {
     my $proto = $1;
     my $url = $'; #';
     die unless $proto eq 'madison';
     my $proto = $1;
     my $url = $'; #';
     die unless $proto eq 'madison';
-    $rmad ||= cmdoutput qw(rmadison -asource),"-s$suite","-u$url",$package;
+    $rmad{$package} ||= cmdoutput
+       qw(rmadison -asource),"-s$suite","-u$url",$package;
+    my $rmad = $rmad{$package};
     if (!length $rmad) {
        return ();
     }
     $rmad =~ m{^ \s*( [^ \t|]+ )\s* \|
                  \s*( [^ \t|]+ )\s* \|
     if (!length $rmad) {
        return ();
     }
     $rmad =~ m{^ \s*( [^ \t|]+ )\s* \|
                  \s*( [^ \t|]+ )\s* \|
-                 \s*( [^ \t|/]+ )(?:/([^ \t|/]+)) \s* \|
+                 \s*( [^ \t|/]+ )(?:/([^ \t|/]+))? \s* \|
                  \s*( [^ \t|]+ )\s* }x or die "$rmad $?";
     $1 eq $package or die "$rmad $package ?";
     my $vsn = $2;
                  \s*( [^ \t|]+ )\s* }x or die "$rmad $?";
     $1 eq $package or die "$rmad $package ?";
     my $vsn = $2;
@@ -245,7 +248,7 @@ sub archive_query () {
 }
 
 sub canonicalise_suite () {
 }
 
 sub canonicalise_suite () {
-    archive_query();
+    archive_query() or die;
 }
 
 sub get_archive_dsc () {
 }
 
 sub get_archive_dsc () {
@@ -645,7 +648,7 @@ sub cmd_push {
     if (@ARGV==0) {
        $suite = $clogp->{Distribution};
        if ($new_package) {
     if (@ARGV==0) {
        $suite = $clogp->{Distribution};
        if ($new_package) {
-           local ($package) = 'dpkg';
+           local ($package) = $existing_package; # this is a hack
            canonicalise_suite();
        }
     } else {
            canonicalise_suite();
        }
     } else {
@@ -665,11 +668,11 @@ sub cmd_build {
     my $clogp = parsechangelog();
     $suite = $clogp->{Distribution};
     $package = $clogp->{Source};
     my $clogp = parsechangelog();
     $suite = $clogp->{Distribution};
     $package = $clogp->{Source};
-    canonicalise_suite();
     runcmd_ordryrun
        qw(git-buildpackage -us -uc --git-no-sign-tags),
     runcmd_ordryrun
        qw(git-buildpackage -us -uc --git-no-sign-tags),
-            "--git-debian-branch=".lbranch(),
-            @ARGV;
+       '--git-builder=dpkg-buildpackage -i\.git/ -I.git',
+       "--git-debian-branch=".lbranch(),
+       @ARGV;
 }
 
 sub parseopts () {
 }
 
 sub parseopts () {
@@ -689,6 +692,8 @@ sub parseopts () {
                $om->[0] = $2;
            } elsif (m/^--(\w+):(.*)/s && ($om = $opts_opt_map{$1})) {
                push @$om, $2;
                $om->[0] = $2;
            } elsif (m/^--(\w+):(.*)/s && ($om = $opts_opt_map{$1})) {
                push @$om, $2;
+           } elsif (m/^--existing-package=(.*)/s) {
+               $existing_package = $1;
            } else {
                die "$_ ?";
            }
            } else {
                die "$_ ?";
            }