Archived
1
0

Introduce Habitent loin people

This commit is contained in:
Mercier Pierre-Olivier 2013-10-20 02:15:12 +02:00
parent 73b1552199
commit ff9c3a5ad2
5 changed files with 15 additions and 4 deletions

View File

@ -38,8 +38,12 @@ sub tinyglob
elsif ($str[$i] eq '*') {
$res .= '.*';
}
elsif ($metaescape) {
$res .= $str[$i];
$metaescape = 0;
}
else {
croak "Invalid number of \\ in '$orig'";
$res .= "\\".$str[$i];
}
}
else {
@ -55,6 +59,8 @@ sub match
my $glob = tinyglob(shift);
my $str = shift;
say $glob;
return $str =~ /$glob/;
}

View File

@ -18,6 +18,9 @@ is(Tinyglob::tinyglob("\\*"), "\\*");
is(Tinyglob::tinyglob("\\\\*"), "\\\\.*");
is(Tinyglob::tinyglob("\\?"), "\\?");
is(Tinyglob::tinyglob("\\\\?"), "\\\\.");
is(Tinyglob::tinyglob("\\."), "\\.");
is(Tinyglob::tinyglob("\\\\."), "\\\\\\.");
is(Tinyglob::tinyglob("a*b?"), "a.*b.");
ok(! Tinyglob::match("?", ""));
ok(! Tinyglob::match("b", "a"));

View File

@ -19,6 +19,8 @@ my $promo = qx(git config hooks.promo);
my $id_project = qx(git config hooks.idproject);
my $repo_login = qx(git config hooks.repologin);
my @habitent_loin = ("amed_m", "bellev_m", "freima_m", "ikouna_l");
# First, check if the repository is in the YYYY/ directory
exit 0 if (($promo && $id_project && $repo_login) || $ENV{GL_REPO} !~ /^2[0-9]{3}\/.+\/.+/);
@ -46,6 +48,8 @@ if ($ip->overlaps($labnetwork) == $IP_A_IN_B_OVERLAP)
# exit 1;
#}
return 0 if (grep { /\Q$repo_login\E/ } @habitent_loin);
my $schoolnetwork = Net::IP->new('10.41.0.0/16');
#my $vjschoolnetwork = Net::IP->new('10.3.0.0/16');

View File

@ -168,7 +168,7 @@ sub run_moulette
opendir(my $dh, $submitdir) or die "Can't list files in $submitdir: $!";
while (readdir($dh))
{
if (/([a-zA-Z0-9_-]+).ff$/ && -f "$submitdir/$_") {
if (/([a-zA-Z0-9_-]+).ff$/ && -f "$submitdir/$_" && ! /^tests\.ff$/) {
push @logins, $1;
}
}

View File

@ -7,8 +7,6 @@ use File::Basename;
use Mail::Internet;
use Pod::Usage;
use lib "../../";
use ACU::Log;
use ACU::LDAP;
use ACU::Process;