From: Daniel Stenberg Date: Sun, 9 Jan 2022 21:28:04 +0000 (+0100) Subject: scripts/copyright.pl: ignore missing files X-Git-Tag: curl-7_82_0~231 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dbde76bdd6018ba68bf7192a514e4048f014cea3;p=thirdparty%2Fcurl.git scripts/copyright.pl: ignore missing files --- diff --git a/scripts/copyright.pl b/scripts/copyright.pl index 089f04a9eb..878f228c26 100755 --- a/scripts/copyright.pl +++ b/scripts/copyright.pl @@ -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 () { 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;