From 326ce946179040991e5946a62ab5e7705c4dc6cf Mon Sep 17 00:00:00 2001 From: Mercier Pierre-Olivier Date: Mon, 30 Sep 2013 10:55:09 +0200 Subject: [PATCH 1/2] Remove liblerdorf directory before untarring sources --- commands/manage-server.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/manage-server.sh b/commands/manage-server.sh index 8081d2b..145bed9 100755 --- a/commands/manage-server.sh +++ b/commands/manage-server.sh @@ -100,6 +100,7 @@ do git archive -o ./liblerdorf.tbz2 master scp ./liblerdorf.tbz2 root@$DEST: cd - + ssh root@$DEST rm -rf liblerdorf ssh root@$DEST mkdir -p liblerdorf ssh root@$DEST tar xf ./liblerdorf.tbz2 -C liblerdorf ssh root@$DEST "DEST=/usr/local/lib/perl5/5.14/ACU make -C liblerdorf upgrade" From 7a192c47323c7dc6910cb43e783c60158cb5849b Mon Sep 17 00:00:00 2001 From: Mercier Pierre-Olivier Date: Mon, 30 Sep 2013 13:08:33 +0200 Subject: [PATCH 2/2] Globbing in grading is not critical --- ACU/Grading.pm | 20 +++++++++++++------- ACU/Tinyglob.pm | 5 +++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ACU/Grading.pm b/ACU/Grading.pm index dd1d64f..6eae26c 100644 --- a/ACU/Grading.pm +++ b/ACU/Grading.pm @@ -344,14 +344,20 @@ sub compute ($$$;$$$) if (defined $ref) { - my $glob = Tinyglob::tinyglob($ref); - if ($glob ne $ref) - { - my $value = 0; - for my $r (grep { /^$glob$/ } keys %$ids) { - $value += $ids->{ $r }; + eval { + my $glob = Tinyglob::tinyglob($ref); + if ($glob ne $ref) + { + my $value = 0; + for my $r (grep { /^$glob$/ } keys %$ids) { + $value += $ids->{ $r }; + } + $ids->{ $ref } = $value; } - $ids->{ $ref } = $value; + }; + if ($@) { + my $err = $@; + log ERROR, $@; } } diff --git a/ACU/Tinyglob.pm b/ACU/Tinyglob.pm index 3c19a5a..6fc9ed8 100644 --- a/ACU/Tinyglob.pm +++ b/ACU/Tinyglob.pm @@ -12,7 +12,8 @@ our @EXPORT = qw(tinyglob); sub tinyglob { - my @str = split("", quotemeta(shift)); + my $orig = shift; + my @str = split("", quotemeta($orig)); my $res = ""; my $metaescape = 0; @@ -38,7 +39,7 @@ sub tinyglob $res .= '.*'; } else { - croak "Invalid number of \\"; + croak "Invalid number of \\ in '$orig'"; } } else {