chiark / gitweb /
Tag change: Rename debiantag to debiantag_old
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Jul 2016 12:51:46 +0000 (13:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 Jul 2016 20:50:00 +0000 (21:50 +0100)
We are going to change the tag name of the main signed tag used by
dgit to signal the user's intent to the archive server.

Prepare for this by changing debiantag to debiantag_old and changing
all call sites outside dgit itself.

dgit will want to be able to generate either, depending on whether
it's cooperating in an rpush with a new or old dgit so reintroduce a
wrapper called debiantag there.  This will also allow us to have dgit
generate old tags for testing.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Debian/Dgit.pm
dgit
infra/dgit-repos-policy-debian
infra/dgit-repos-server

index cb4a599b20849ea13b0656937c2fd15fb006a932..979dd427fcf77fc332a14c2272936809f3e6fb7c 100644 (file)
@@ -19,7 +19,7 @@ BEGIN {
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
     @EXPORT      = qw(setup_sigwarn
-                      debiantag server_branch server_ref
+                      debiantag_old server_branch server_ref
                       stat_exists link_ltarget
                      hashfile
                       fail ensuredir executable_on_path
@@ -125,7 +125,7 @@ sub debugcmd {
     printcmd(\*DEBUG,$debugprefix.$extraprefix,@_) if $debuglevel>0;
 }
 
-sub debiantag ($$) { 
+sub debiantag_old ($$) { 
     my ($v,$distro) = @_;
     $v =~ y/~:/_%/;
     return "$distro/$v";
diff --git a/dgit b/dgit
index b8f00c39e70564da68a060fe48c829c8ab9d7734..45eef630367ae6a1ba7d4fa6ab1b5255671f2515 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -132,6 +132,11 @@ our @ourdscfield = qw(Dgit Vcs-Dgit-Master);
 our $csuite;
 our $instead_distro;
 
+sub debiantag ($$) {
+    my ($v,$distro) = @_;
+    return debiantag_old $v, $distro;
+}
+
 sub lbranch () { return "$branchprefix/$csuite"; }
 my $lbranch_re = '^refs/heads/'.$branchprefix.'/([^/.]+)$';
 sub lref () { return "refs/heads/".lbranch(); }
index 4dab576f1a4257e3bff41aef8ac4f4b1d30105f1..62a275ac837478f10da61ec898f9b6909b19fbc2 100755 (executable)
@@ -109,7 +109,7 @@ sub apiquery ($) {
 sub vsn_in_our_history ($) {
     my ($vsn) = @_;
 
-    my $tagref = "refs/tags/".debiantag $vsn, $distro;
+    my $tagref = "refs/tags/".debiantag_old $vsn, $distro;
     printdebug " checking history  vsn=$vsn tagref=$tagref\n";
     $?=0; my $r = system qw(git show-ref --verify --quiet), $tagref;
     return 1 if !$r;
index cfa0f314fffc312b08aa9b47395215d1d7cc0671..ea223a0c33bddcd18fe5089ac74013a878dd0b89 100755 (executable)
@@ -342,7 +342,7 @@ sub movetogarbage () {
 
     ensuredir "$dgitrepos/_removed-tags";
     open PREVIOUS, ">>", removedtagsfile or die removedtagsfile." $!";
-    git_for_each_ref('refs/tags/'.debiantag('*',$distro), sub {
+    git_for_each_ref('refs/tags/'.debiantag_old('*',$distro), sub {
        my ($objid,$objtype,$fullrefname,$reftail) = @_;
        print PREVIOUS "\n$objid $reftail .\n" or die $!;
     }, $real);
@@ -821,7 +821,7 @@ sub checks () {
     tagh1('object') eq $commit or reject "tag refers to wrong commit";
     tagh1('tag') eq $tagname or reject "tag name in tag is wrong";
 
-    my $expecttagname = debiantag $version, $distro;
+    my $expecttagname = debiantag_old $version, $distro;
     printdebug "expected tag $expecttagname\n";
     $tagname eq $expecttagname or die;