]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
scripts/copyright.pl: ignore missing files
authorDaniel Stenberg <daniel@haxx.se>
Sun, 9 Jan 2022 21:28:04 +0000 (22:28 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 9 Jan 2022 21:28:04 +0000 (22:28 +0100)
scripts/copyright.pl

index 089f04a9ebb7e80532f4b447641303cd78a8f510..878f228c265ddb69788e478f66856fad739372f1 100755 (executable)
@@ -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;