chiark / gitweb /
remote fixes - fix tag handling
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Oct 2013 11:53:54 +0000 (12:53 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Oct 2013 11:53:54 +0000 (12:53 +0100)
dgit

diff --git a/dgit b/dgit
index cb4e497778697d8f432b1680f72040e4df8b3cf0..497687ac2b7932d34a4eb5f893a0bdb647339b81 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1533,6 +1533,7 @@ sub i_resp_file ($) {
     my $localpath = "$i_tmp/$localname";
     stat $localpath and badproto \*RO, "file $keyword ($localpath) twice";
     protocol_receive_file \*RO, $localpath;
     my $localpath = "$i_tmp/$localname";
     stat $localpath and badproto \*RO, "file $keyword ($localpath) twice";
     protocol_receive_file \*RO, $localpath;
+    i_method "i_file", $keyword;
 }
 
 our %i_param;
 }
 
 our %i_param;
@@ -1555,21 +1556,35 @@ sub i_resp_want ($) {
     print RI "files-end\n" or die $!;
 }
 
     print RI "files-end\n" or die $!;
 }
 
-our ($i_clogp, $i_version, $i_tag, $i_dscfn);
+our ($i_clogp, $i_version, $i_tag, $i_dscfn, $i_changesfn);
 
 
-sub i_localname_parsed_changelog { return "remote-changelog.822"; }
-sub i_localname_changes { return "remote.changes"; }
-sub i_localname_dsc {
+sub i_localname_parsed_changelog {
+    return "remote-changelog.822";
+}
+sub i_file_parsed_changelog {
     ($i_clogp, $i_version, $i_tag, $i_dscfn) =
        push_parse_changelog "$i_tmp/remote-changelog.822";
     die if $i_dscfn =~ m#/|^\W#;
     ($i_clogp, $i_version, $i_tag, $i_dscfn) =
        push_parse_changelog "$i_tmp/remote-changelog.822";
     die if $i_dscfn =~ m#/|^\W#;
+}
+
+sub i_localname_dsc {
+    defined $i_dscfn or badproto \*RO, "dsc (before parsed-changelog)";
     return $i_dscfn;
 }
     return $i_dscfn;
 }
+sub i_file_dsc { }
+
+sub i_localname_changes {
+    defined $i_dscfn or badproto \*RO, "dsc (before parsed-changelog)";
+    $i_changesfn = $i_dscfn;
+    $i_changesfn =~ s/\.dsc$/_dgit.changes/ or die;
+    return $i_changesfn;
+}
+sub i_file_changes { }
 
 sub i_want_signed_tag {
     printdebug Dumper(\%i_param, $i_dscfn);
     defined $i_param{'head'} && defined $i_dscfn && defined $i_clogp
 
 sub i_want_signed_tag {
     printdebug Dumper(\%i_param, $i_dscfn);
     defined $i_param{'head'} && defined $i_dscfn && defined $i_clogp
-       or badproto \*RO, "sequencing error";
+       or badproto \*RO, "premature desire for signed-tag";
     my $head = $i_param{'head'};
     die if $head =~ m/[^0-9a-f]/ || $head !~ m/^../;
 
     my $head = $i_param{'head'};
     die if $head =~ m/[^0-9a-f]/ || $head !~ m/^../;
 
@@ -1578,7 +1593,7 @@ sub i_want_signed_tag {
     my $tagobjfn =
        push_mktag $head, $i_clogp, $i_tag,
            $i_dscfn,
     my $tagobjfn =
        push_mktag $head, $i_clogp, $i_tag,
            $i_dscfn,
-           'remote.changes', 'remote changes',
+           $i_changesfn, 'remote changes',
            sub { "tag$_[0]"; };
 
     return $tagobjfn;
            sub { "tag$_[0]"; };
 
     return $tagobjfn;
@@ -1586,8 +1601,8 @@ sub i_want_signed_tag {
 
 sub i_want_signed_dsc_changes {
     rename "$i_dscfn.tmp","$i_dscfn" or die "$i_dscfn $!";
 
 sub i_want_signed_dsc_changes {
     rename "$i_dscfn.tmp","$i_dscfn" or die "$i_dscfn $!";
-    sign_changes 'remote.changes';
-    return ($i_dscfn, 'remote.changes');
+    sign_changes $i_changesfn;
+    return ($i_dscfn, $i_changesfn);
 }
 
 #---------- building etc. ----------
 }
 
 #---------- building etc. ----------