File: refcheck.pl

package info (click to toggle)
ck 0.7.2-8
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 3,060 kB
  • sloc: ansic: 31,787; makefile: 1,317; sh: 805; perl: 21
file content (27 lines) | stat: -rwxr-xr-x 509 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

use warnings;
use strict;

my @files = @ARGV;

my $h;

foreach my $file (@files) {
    $h->{$file} = 1;
}

foreach my $file (@files) {
    open(my $fh, "<", $file) or die "cannot open < $file: $!";
    while (<$fh>) {
        chomp;
        if ($_ =~ /\.Xr ((ck|CK)_[a-zA-Z_]+) ([0-9])/) {
	    my $name = $1;
	    my $section = $3;
	    if (!$h->{$name}) {
		print STDERR "$file: ref to missing ${name}($section)\n";
	    }
        }
    }
    close($fh) or die("cannot close $file: $!");
}