X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=e4b1177dc23896b2389030e70e7a5a6bca0c2890;hp=d4a091056331d2041e4a566d0f85e8b5fffb5a8f;hb=8601f11872048f1e3209188d2636d7344c75177e;hpb=09174e8172ee86effe190827c24045fd8096d26f diff --git a/dgit b/dgit index d4a09105..e4b1177d 100755 --- a/dgit +++ b/dgit @@ -33,6 +33,7 @@ our $sign = 1; 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)"); @@ -208,7 +209,7 @@ sub parsechangelog { return $c; } -our $rmad; +our %rmad; 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'; - $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* \| - \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; @@ -245,7 +248,7 @@ sub archive_query () { } sub canonicalise_suite () { - archive_query(); + archive_query() or die; } sub get_archive_dsc () { @@ -645,7 +648,7 @@ sub cmd_push { if (@ARGV==0) { $suite = $clogp->{Distribution}; if ($new_package) { - local ($package) = 'dpkg'; + local ($package) = $existing_package; # this is a hack canonicalise_suite(); } } else { @@ -665,11 +668,11 @@ sub cmd_build { my $clogp = parsechangelog(); $suite = $clogp->{Distribution}; $package = $clogp->{Source}; - canonicalise_suite(); 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 () { @@ -689,6 +692,8 @@ sub parseopts () { $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 "$_ ?"; }