epita-std
/
ACU
Archived
1
0
Fork 0

Mark ACU- and YAKA- as reserved tag

This commit is contained in:
Mercier Pierre-Olivier 2013-12-08 08:28:49 +01:00
parent 0e3fe1fd1c
commit cdb64f192f
1 changed files with 8 additions and 3 deletions

View File

@ -375,17 +375,22 @@ sub tag_project
my $mod = 0;
for my $vcs ($dom->documentElement()->getElementsByTagName("vcs"))
{
if (! $vcs->hasAttribute("tag") || $vcs->getAttribute("tag") =~ /^(ACU|YAKA)-/) {
log ERROR, "Un tag de rendu ne peut pas commencer par ACU- ou YAKA-."; # C'est réservé pour les moulettes
}
if (! $vcs->hasAttribute("token"))
{
if ($project)
{
# Looking for an old token
my @rendus = grep {
exists $_->{vcs} and $_->{vcs}{tag} eq $vcs->hasAttribute("tag");
exists $_->{vcs} and $_->{vcs}{tag} eq $vcs->getAttribute("tag");
} @{ $project->{submissions} };
if (@rendus == 1) {
log INFO, "Use existing token: ".$rendus[0]->{vcs}{token};
if (@rendus == 1)
{
log DEBUG, "Use existing token: ".$rendus[0]->{vcs}{token};
$vcs->setAttribute("token", substr($rendus[0]->{vcs}{token}, 2, 23));
$mod = 1;
next;