From: Ian Jackson Date: Sun, 17 Jul 2016 12:51:46 +0000 (+0100) Subject: Tag change: Rename debiantag to debiantag_old X-Git-Tag: archive/debian/2.0~248 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=26f2213a36af62d526a41ad96caef7f3c4aa507a Tag change: Rename debiantag to debiantag_old 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 --- diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index cb4a599b..979dd427 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -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 b8f00c39..45eef630 100755 --- 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(); } diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 4dab576f..62a275ac 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -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; diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server index cfa0f314..ea223a0c 100755 --- a/infra/dgit-repos-server +++ b/infra/dgit-repos-server @@ -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;