]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
look for #! to determine if the file is PYTHON or PYTHON-BIN
authorMark Andrews <marka@isc.org>
Mon, 5 Feb 2018 00:31:36 +0000 (11:31 +1100)
committerMark Andrews <marka@isc.org>
Mon, 5 Feb 2018 00:41:05 +0000 (11:41 +1100)
(cherry picked from commit 4fcc550877de226492f5205b627be6ed0f77b6aa)

util/merge_copyrights

index 3bde8e74373c448802b62124df1ac196d78dd54d..2f4a1786aebc3e3a631bb760e3a111167628411f 100644 (file)
@@ -80,6 +80,11 @@ while (<CHANGES>) {
            $file_types{$_} = "PERL";
        } elsif ($base =~ /\.py$/i) {
            $file_types{$_} = "PYTHON";
+           if (open(PYTHON, $_)) {
+             my $line = <PYTHON>;
+             $file_types{$_} = "PYTHON-BIN" if ($line && $line =~ /^#!/);
+             close(PYTHON);
+           }
        } elsif ($base =~ /\.sh$/) {
            $file_types{$_} = "SH";
        } elsif ($base =~ /\.docbook$/ ||