50 lines
826 B
Perl
50 lines
826 B
Perl
#!/usr/bin/env perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
use v5.10;
|
|
use Digest::SHA qw(sha1_base64);
|
|
use File::Basename;
|
|
use utf8;
|
|
|
|
use ACU::API::Projects;
|
|
use ACU::Defense;
|
|
use ACU::LDAP;
|
|
use ACU::Log;
|
|
$ACU::Log::log_file = "/var/log/hooks/" . basename($0) . ".log";
|
|
use ACU::Process;
|
|
|
|
# First, check if the repository is in the conferences/ directory
|
|
exit 0 if ($ENV{GL_REPO} !~ /^conferences\//);
|
|
|
|
my ($ref, $oldsha, $newsha) = @ARGV;
|
|
|
|
log DONE, "This is a conference repository!";
|
|
|
|
my %known_tags = (
|
|
"subject" => \&tag_document,
|
|
);
|
|
|
|
if ($ref =~ m<^refs/tags(/.+)$>)
|
|
{
|
|
my $tag = $1;
|
|
my @args;
|
|
|
|
while ($tag =~ m<[,/]([^,]*)>g) {
|
|
push @args, $1;
|
|
}
|
|
|
|
my $create = ($newsha ne '0' x 40);
|
|
|
|
if (exists $known_tags{$args[0]}) {
|
|
exit $known_tags{$args[0]}($create, @args);
|
|
}
|
|
}
|
|
|
|
exit 0;
|
|
|
|
sub tag_document
|
|
{
|
|
|
|
}
|