#!/usr/bin/perl
# Make note of the files described in the Files.txt of each directory.
open(INPUT, "cat */Files.txt |") || die "cat pipeline: $!";
while () {
die unless /.*\t.*\t(.*)\t/;
$f = $1;
$f .= ".pdf" if $f =~ /-d\d*$/;
$f .= ".pdf" if $f =~ /-dn\d*$/;
$f .= ".pdf" if $f =~ /-la\d*$/;
$f .= ".pdf" if $f =~ /^aa-/;
$files{"$f"} = 1;
#warn "xspla1: $1.pdf\n" if /xspla/;
}
# Now check that all the PDF were mentioned.
open(INPUT, "ls -d */* |") || die "ls pipeline: $!";
while () {
$f = $dir = $_;
$f =~ s/\r//g; chop $f;
next if -d $f;
$f =~ s:.*/::;
next if defined $files{$f};
next if $f =~ /[.]\d$/;
next if $f =~ /[.]bin$/;
next if $f =~ /[.]bn$/;
next if $f =~ /[.]dsk$/;
next if $f =~ /[.]doc$/;
next if $f =~ /[.]htm$/;
next if $f =~ /[.]jpg$/;
next if $f =~ /[.]lbl$/;
next if $f =~ /[.]lst$/;
next if $f =~ /[.]od$/;
next if $f =~ /[.]old$/;
next if $f =~ /[.]org$/;
next if $f =~ /[.]pa$/i;
next if $f =~ /[.]pal$/;
next if $f =~ /[.]pt$/;
next if $f =~ /[.]sym$/;
next if $f =~ /[.]syms$/;
next if $f =~ /[.]txt$/;
next if $f =~ /[.]xml$/;
next if $f =~ /[.]zip$/;
next if $f =~ /-sv$/;
#warn "xspla2: $f\n" if $f =~ /xspla/;
print "$dir";
}