From ecf03827c19e4cfbb9e220cafeb04cdd3ffd08f6 Mon Sep 17 00:00:00 2001 From: Mercier Pierre-Olivier Date: Sat, 14 Sep 2013 17:40:23 +0200 Subject: [PATCH] Hook subject OK --- hooks/subjects.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hooks/subjects.pl b/hooks/subjects.pl index 30e2cf1..eecec36 100755 --- a/hooks/subjects.pl +++ b/hooks/subjects.pl @@ -31,7 +31,7 @@ if ($ref =~ m<^refs/tags(/.+)$>) my $tag = $1; my @args; - while ($tag =~ m<[:/]([^:]+)>g) { + while ($tag =~ m<[,/]([^,]+)>g) { push @args, $1; } @@ -65,7 +65,7 @@ sub check_xml sub repository_name { my $repo = $ENV{GL_REPO}; - $repo =~ s/^subjects\\(.*)/$1/; + $repo =~ s#^subjects/(.*)#$1#; return $repo; } @@ -143,8 +143,12 @@ sub tag_project # Send data to intradata log INFO, "Attente d'un processus de publication..."; - log ERROR, "Erreur durant le processus de publication : $_" - if (Process::Client::launch("intradata_get", { action => "update", type => "project", id => $project_id, "year" => $year }, { "butler.xml" => $content })); + if (my $err = Process::Client::launch("intradata_get", { action => "update", type => "project", id => $project_id, "year" => $year }, { "butler.xml" => $content })) + { + if (${ $err } ne "Ok") { + log ERROR, "Erreur durant le processus de publication : " . ${ $err }; + } + } # Call API log ERROR, $_ if(API::Projects::add($project_id, $year));