diff options
-rwxr-xr-x | videodb-check.pl | 18 |
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; } |