| 1 | #!/bin/perl |
|---|
| 2 | $file = @ARGV[0]; |
|---|
| 3 | open(FILE, "<$file") || die "unable to open $file"; |
|---|
| 4 | |
|---|
| 5 | @lines = <FILE>; |
|---|
| 6 | if(!(@lines[0] =~ /^<\?php\s*\n/ && |
|---|
| 7 | @lines[1] eq "/**\n" && |
|---|
| 8 | @lines[2] eq " * Piwik - Open source web analytics\n" && |
|---|
| 9 | @lines[3] =~ /^ \*\s*\n/ && |
|---|
| 10 | @lines[4] eq " * \@link http://piwik.org\n" && |
|---|
| 11 | @lines[5] eq " * \@license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later\n" && |
|---|
| 12 | @lines[6] =~ /^ \* \@version \$Id: .*?\$/ && |
|---|
| 13 | @lines[7] =~ /^ \*\s*\n/)) { |
|---|
| 14 | # print name of files which don't have a matching header |
|---|
| 15 | print "$file\n"; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | close(FILE); |
|---|