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>
$VERSION = 1.00;
@ISA = qw(Exporter);
@EXPORT = qw(setup_sigwarn
$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
stat_exists link_ltarget
hashfile
fail ensuredir executable_on_path
printcmd(\*DEBUG,$debugprefix.$extraprefix,@_) if $debuglevel>0;
}
printcmd(\*DEBUG,$debugprefix.$extraprefix,@_) if $debuglevel>0;
}
+sub debiantag_old ($$) {
my ($v,$distro) = @_;
$v =~ y/~:/_%/;
return "$distro/$v";
my ($v,$distro) = @_;
$v =~ y/~:/_%/;
return "$distro/$v";
our $csuite;
our $instead_distro;
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(); }
sub lbranch () { return "$branchprefix/$csuite"; }
my $lbranch_re = '^refs/heads/'.$branchprefix.'/([^/.]+)$';
sub lref () { return "refs/heads/".lbranch(); }
sub vsn_in_our_history ($) {
my ($vsn) = @_;
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;
printdebug " checking history vsn=$vsn tagref=$tagref\n";
$?=0; my $r = system qw(git show-ref --verify --quiet), $tagref;
return 1 if !$r;
ensuredir "$dgitrepos/_removed-tags";
open PREVIOUS, ">>", removedtagsfile or die removedtagsfile." $!";
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);
my ($objid,$objtype,$fullrefname,$reftail) = @_;
print PREVIOUS "\n$objid $reftail .\n" or die $!;
}, $real);
tagh1('object') eq $commit or reject "tag refers to wrong commit";
tagh1('tag') eq $tagname or reject "tag name in tag is wrong";
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;
printdebug "expected tag $expecttagname\n";
$tagname eq $expecttagname or die;