Archived
1
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

View File

@ -375,17 +375,22 @@ sub tag_project
my $mod = 0; my $mod = 0;
for my $vcs ($dom->documentElement()->getElementsByTagName("vcs")) 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 (! $vcs->hasAttribute("token"))
{ {
if ($project) if ($project)
{ {
# Looking for an old token # Looking for an old token
my @rendus = grep { my @rendus = grep {
exists $_->{vcs} and $_->{vcs}{tag} eq $vcs->hasAttribute("tag"); exists $_->{vcs} and $_->{vcs}{tag} eq $vcs->getAttribute("tag");
} @{ $project->{submissions} }; } @{ $project->{submissions} };
if (@rendus == 1) { if (@rendus == 1)
log INFO, "Use existing token: ".$rendus[0]->{vcs}{token}; {
log DEBUG, "Use existing token: ".$rendus[0]->{vcs}{token};
$vcs->setAttribute("token", substr($rendus[0]->{vcs}{token}, 2, 23)); $vcs->setAttribute("token", substr($rendus[0]->{vcs}{token}, 2, 23));
$mod = 1; $mod = 1;
next; next;