chiark / gitweb /
Infra: in dgit-repos-policy-debian, fix history tagg lookup
[dgit.git] / infra / dgit-repos-policy-debian
index dd2a9c80be10bffb2828f06217d9c97a1a2edf1f..6e0f0dc3024bfbf6f80eb672f54f695b0cf9fdd2 100755 (executable)
@@ -98,15 +98,16 @@ sub apiquery ($) {
 
 sub specific_suite_has_vsn_in_our_history ($) {
     my ($suite) = @_;
-    my $in_suite = apiquery "/dsc_in_suite/$suite/$pkg";
+    my $in_suite = apiquery "dsc_in_suite/$suite/$pkg";
     foreach my $entry (@$in_suite) {
        my $vsn = $entry->{version};
        die "$pkg ?" unless defined $vsn;
-       my $tag = debiantag $vsn;
-       $?=0; my $r = system qw(git show-ref --verify --quiet), $tag;
+       my $tagref = "refs/tags/".debiantag $vsn;
+       printdebug " checking history suite=$suite vsn=$vsn tagref=$tagref\n";
+       $?=0; my $r = system qw(git show-ref --verify --quiet), $tagref;
        return 1 if !$r;
        next if $r==256;
-       die "$pkg tag $tag $? $!";
+       die "$pkg tagref $tagref $? $!";
     }
     return 0;
 }
@@ -116,7 +117,7 @@ sub new_has_vsn_in_our_history () {
 }
 
 sub good_suite_has_vsn_in_our_history () {
-    my $suites = apiquery "/suites";
+    my $suites = apiquery "suites";
     foreach my $suitei (@$suites) {
        my $suite = $suitei->{name};
        die unless defined $suite;
@@ -251,6 +252,8 @@ sub deliberately ($) { return $deliberately{$_[0]}; }
 
 sub action_push () {
     getpackage();
+    getpushinfo();
+
     return 0 unless $pkg_exists;
     return 0 unless $pkg_secret;
 
@@ -275,8 +278,9 @@ sub action_push () {
 
 sub action_push_confirm () {
     getpackage();
-    die unless @ARGV >= 5;
-    my $freshrepo = $ARGV[4];
+    getpushinfo();
+    die unless @ARGV >= 1;
+    my $freshrepo = shift @ARGV;
 
     my $initq = $poldbh->prepare(<<END);
         SELECT taint_id, gitobjid FROM taints t