mirror of
https://github.com/systemd/systemd.git
synced 2024-10-30 14:55:37 +03:00
820d14e3df
Add CC0 as the license. SPDX does not have a "public domain" tag, but CC0 is more or less equivalent. We should have *some* header to avoid doubts in the future.
24 lines
493 B
Perl
Executable File
24 lines
493 B
Perl
Executable File
# SPDX-License-Identifier: CC0-1.0
|
|
#!/usr/bin/env perl
|
|
#
|
|
# checkincludes: Find files included more than once in (other) files.
|
|
|
|
foreach $file (@ARGV) {
|
|
open(FILE, $file) or die "Cannot open $file: $!.\n";
|
|
|
|
my %includedfiles = ();
|
|
|
|
while (<FILE>) {
|
|
if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) {
|
|
++$includedfiles{$1};
|
|
}
|
|
}
|
|
foreach $filename (keys %includedfiles) {
|
|
if ($includedfiles{$filename} > 1) {
|
|
print "$file: $filename is included more than once.\n";
|
|
}
|
|
}
|
|
|
|
close(FILE);
|
|
}
|