Archived
1
0
Fork 0

Works on old LWP::UserAgent

This commit is contained in:
Mercier Pierre-Olivier 2013-09-16 06:43:17 +02:00
commit 3678b13055
4 changed files with 59 additions and 5 deletions

View file

@ -42,6 +42,43 @@ if ($ref =~ m<^refs/tags/(.+)$>)
}
log TRACE, $project;
# Extract lot of data
my @rendus = grep {
exists $_->{vcs} and $_->{vcs}{tag} eq $tag;
} @{ $project->{submissions} };
my $date = $ENV{'GL_TS'};
$date =~ s/\./ /;
my $glts = ParseDate($date);
chomp (my $tokengiven = `git cat-file tag $newsha | sed -e '1,/^\$/d'`);
for my $rendu (@rendus)
{
my $open = ParseDate($rendu->{period}{begin});
my $close = ParseDate($rendu->{period}{end});
# TODO: check exceptions by login/group
if ((Date_Cmp($glts, $open) == -1))
{
print "[ACU] Tag not allowed: upload not yet opened!\n";
exit(4);
}
if ((Date_Cmp($glts, $close) == 1))
{
print "[ACU] Tag not allowed: upload closed!\n";
exit(5);
}
my $token = $rendu->{vcs}{token};
if ($token ne "" and $token ne $tokengiven)
{
print "[ACU] Error 0x65cd58: Bad token.\n";
exit(6);
}
}
}
exit 1;