#!/usr/bin/perl
# Copyright 2000 Tom Rothamel. No warranty, GPL.

@exempt = qw(
.
./Makefile.in
./README
./COPYING
./Makefile.am
./aclocal.m4
./configure
./configure.in
./install-sh
./missing
./mkinstalldirs
./idbg.1
./idbg.html
./idbg.txt
./idbg.pod
./src
./src/Makefile.in
./src/Makefile.am
);

for $i (@exempt) {
	$exempt{$i} = 1;
}


chdir $ARGV[0];

open FIND, "find |";

while (<FIND>) {
	chomp $_;

	next unless -f $_;

	if ($exempt{$_}) {
		next;
	}

	print $_, ': ';
	
	my $line;

	open FILE, "<" . $_;
	while ($line = <FILE>) {
		last if $line =~ /Copyright/i;
	}
	close FILE;

	if ($line =~ /(Copyright.*)$/i) {
		print $1, "\n";
		next;
	}

	print "No copyright.\n";
	exit -1;
}

exit 0;
