#! /usr/bin/perl

my %filenames;
my $fh = undef;
my $line;

if(open($fh, "<filelist.txt")) {
  while(<$fh>) {
    $line = $_; chomp($line);
    $filenames{"$line"} = 1;
  }
  close($fh); $fh = undef;
  if(open($fh, "find . -type f |")) {
    while(<$fh>) {
      $line = $_; chomp($line);
      $runtest = 1;
      if($line =~ /\.git\//o) {
        $runtest = 0;
      }
      if($line =~ /\.\/doc\//o) {
        $runtest = 0;
      }
      if($line =~ /\.\/devdoc\//o) {
        $runtest = 0;
      }
      if(0 != $runtest) {
      if(!(exists($filenames{"$line"}))) {
        print "Extra file: $line\n";
      }
      }
    }
    close($fh);
  }
}

