From a953f64925b6e1031d11502b6629cc6010812ffc Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 11 Jan 2012 15:03:44 +0100 Subject: no multi-director formating; stderr -> stdout --- videodb-check.pl | 18 +++++++----------- 1 file 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; } -- cgit v1.2.3