scripts/copyright.pl: ignore missing files

This commit is contained in:
Daniel Stenberg 2022-01-09 22:28:04 +01:00
parent d8218d45e4
commit dbde76bdd6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -88,8 +88,7 @@ sub scanfile {
my ($f) = @_;
my $line=1;
my $found = 0;
open(F, "<$f") ||
print ERROR "can't open $f\n";
open(F, "<$f") || return -1;
while (<F>) {
chomp;
my $l = $_;
@ -120,9 +119,14 @@ sub checkfile {
@copyright=();
my $found = scanfile($file);
if(!$found) {
print "$file:1: missing copyright range\n";
return 2;
if($found < 1) {
if(!$found) {
print "$file:1: missing copyright range\n";
return 2;
}
# this means the file couldn't open - it might not exist, consider
# that fine
return 0;
}
my $commityear = undef;