summaryrefslogtreecommitdiffstats
path: root/doc/refcheck.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-23 11:24:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-23 11:24:09 +0000
commite36b37583bebd229102f46c4ed7d2f6fad8697d4 (patch)
tree73937b6f051fcaaa1ccbdfbaa9f3a1f36bbedb9e /doc/refcheck.pl
parentInitial commit. (diff)
downloadck-6d53a21133386887b01bcd943e9fd29ee6aa7468.tar.xz
ck-6d53a21133386887b01bcd943e9fd29ee6aa7468.zip
Adding upstream version 0.6.0.upstream/0.6.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/refcheck.pl')
-rwxr-xr-xdoc/refcheck.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/refcheck.pl b/doc/refcheck.pl
new file mode 100755
index 0000000..1ed3a65
--- /dev/null
+++ b/doc/refcheck.pl
@@ -0,0 +1,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: $!");
+}