Archived
1
0
Fork 0

Long tag for defense

This commit is contained in:
Mercier Pierre-Olivier 2013-09-20 02:50:12 +02:00
parent 951470b06b
commit 42a73c9031

View file

@ -87,13 +87,7 @@ sub tag_defense
my $version = $_[2] // 1;
my $project_id = repository_name();
if ($_[3])
{
# Check on ID/flavour_id
if ($_[3] =~ /^\d+$/) {
log ERROR, "defense:* tag can't take version. Tag format: defense:version:id:year";
}
if ($_[3]) {
$project_id .= "-" . $_[3];
}
$project_id = lc $project_id;
@ -144,6 +138,13 @@ sub tag_defense
$year = LDAP::get_year;
}
# Determine full tag
my $long_tag;
{
my $proj_id = $_[3] // "";
$long_tag = "defense,$version,$proj_id,$path,$year";
}
if ($creation)
{
my $newref = $ARGV[2];
@ -175,6 +176,29 @@ sub tag_defense
}
}
if ($long_tag)
{
qx(git tag -f $long_tag);
if (! $?) {
log INFO, "Tag long créé : $long_tag.";
}
}
}
else
{
# Is the long tag existing
qx(git tag | egrep "^$long_tag\$");
if ($?) {
log ERROR, "Tag long correspondant introuvable : $long_tag.";
}
if ($long_tag)
{
qx(git tag -d $long_tag);
if (! $?) {
log INFO, "Tag long supprimé : $long_tag.";
}
}
}
}