summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-01-11 15:03:44 +0100
committerGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-01-11 15:03:44 +0100
commita953f64925b6e1031d11502b6629cc6010812ffc (patch)
treed5abe23265843b861c19afb1a988bd202174cd2e
parent42acb9c184c40fbcb6f4e7df7e8c2200a3ff8321 (diff)
no multi-director formating; stderr -> stdout
-rwxr-xr-xvideodb-check.pl18
1 files changed, 7 insertions, 11 deletions
diff --git a/videodb-check.pl b/videodb-check.pl
index 14a52e2..f56a090 100755
--- a/videodb-check.pl
+++ b/videodb-check.pl
@@ -123,6 +123,7 @@ if (@ARGV) {
pod2usage(-exitstatus => 0, -verbose => 2) if $ARGV[0] eq '--man';
pod2usage(2);
}
+*LOG = *STDOUT;
################################################################################
@@ -160,16 +161,11 @@ foreach (@$res) {
and $target[1] eq "DIRECTORS"
and -f File::Spec->catfile ($symlinks, $_->[0]) );
- my @directors = split / *, */, $_->[1];
- if (@directors) {
- my $lastdir = pop @directors;
- my $directors = join ", ", @directors;
- $directors .= " & " if @directors;
- $directors .= $lastdir;
- push @dirs, $_->[0]. " (" .$target[2]. " <> " .$_->[1]. ")" unless $target[2] eq $directors;
+ if ( not (defined $_->[1]) or $_->[1] eq '' ) {
+ push @dirs, $_->[0]. " (no director)";
}
- else {
- push @dirs, $_->[0]. " (no director)" ;
+ elsif ( $target[2] ne $_->[1] ) {
+ push @dirs, $_->[0]. " (" .$target[2]. " <> " .$_->[1]. ")";
}
}
@@ -236,9 +232,9 @@ exit $r;
sub report {
my ($str, $bad) = @_;
if (@$bad) {
- print STDERR "* " .$str. ":\n";
+ print LOG "* " .$str. ":\n";
foreach (@$bad) {
- print STDERR " ", $_, "\n";
+ print LOG " ", $_, "\n";
}
$r = 1;
}