Docker and build updates
[termux-packages] / packages / ldns / doc-doxyparse.pl.patch
CommitLineData
3c323c69
FF
1Patch allowing building with perl 5.22.
2
3Will be included in the next ldns release:
4 http://git.nlnetlabs.nl/ldns/commit/?h=develop&id=168ee09a
5
6diff --git a/doc/doxyparse.pl b/doc/doxyparse.pl
7index 96a1732..a09b2e8 100755
8--- a/doc/doxyparse.pl
9+++ b/doc/doxyparse.pl
10@@ -57,10 +57,15 @@ This manpage was automaticly generated from the ldns source code by
11 use of Doxygen and some perl.
12 ";
13
14-getopts("m:",\%options);
15+getopts("em:",\%options);
16 # if -m manpage file is given process that file
17 # parse the file which tells us what manpages go together
18 my $functions, $see_also;
19+my $i = -1;
20+my $report_errors = defined $options{'e'};
21+my $errors = 0;
22+my %unique;
23+
24 if (defined $options{'m'}) {
25 # process
26 open(MAN, "<$options{'m'}") or die "Cannot open $options{'m'}";
27@@ -68,18 +73,35 @@ if (defined $options{'m'}) {
28 # func1, func2, .. | see_also1, see_also2, ...
29 while(<MAN>) {
30 chomp;
31+ $i += 1;
32 if (/^#/) { next; }
33 if (/^$/) { next; }
34- ($functions, $see_also) = split /[\t ]*\|[\t ]*/, $_;
35- #print "{$functions}\n";
36- #print "{$see_also}\n";
37+ my @parts = split /[\t ]*\|[\t ]*/, $_;
38+ $functions = shift @parts;
39+ $see_also = join ', ', @parts;
40+ print "{$functions}\n";
41+ print "{$see_also}\n";
42 my @funcs = split /[\t ]*,[\t ]*/, $functions;
43 my @also = split /[\t ]*,[\t ]*/, $see_also;
44 $manpages{$funcs[0]} = \@funcs;
45 $see_also{$funcs[0]} = \@also;
46+ foreach (@funcs) {
47+ if ($unique{$_}) {
48+ push $unique{$_}, ($i,);
49+ } else {
50+ $unique{$_} = [$i];
51+ }
52+ }
53 #print "[", $funcs[0], "]\n";
54 }
55 close(MAN);
56+ while (($func, $lines) = each %unique ) {
57+ if (scalar @$lines > 1) {
58+ print STDERR "$func in function_manpages on lines: "
59+ . join(", ",@$lines) . "\n" if $report_errors;
60+ $errors += 1;
61+ }
62+ }
63 } else {
64 print "Need -m file to process the .h files\n";
65 exit 1;
66@@ -95,7 +117,7 @@ mkdir "doc/man";
67 mkdir "doc/man/man$MAN_SECTION";
68
69 $state = 0;
70-my $i;
71+$i = 0;
72 my @lines = <STDIN>;
73 my $max = @lines;
74
75@@ -273,7 +295,7 @@ foreach (keys %manpages) {
76
77 print MAN $MAN_MIDDLE;
78
79- if (defined(@$also)) {
80+ if (@$also) {
81 print MAN "\n.SH SEE ALSO\n\\fI";
82 print MAN join "\\fR, \\fI", @$also;
83 print MAN "\\fR.\nAnd ";
84@@ -290,7 +312,7 @@ foreach (keys %manpages) {
85 # create symlinks
86 chdir("$BASE/man$MAN_SECTION");
87 foreach (@$name) {
88- print STDERR $_,"\n";
89+ print STDOUT $_,"\n";
90 my $new_file = $_ . "." . $MAN_SECTION;
91 if ($new_file eq $symlink_file) {
92 next;
93@@ -301,3 +323,12 @@ foreach (keys %manpages) {
94 chdir("../../.."); # and back, tricky and fragile...
95 close(MAN);
96 }
97+foreach (keys %api) {
98+ next if (/ / || /^$/);
99+ if (not $unique{$_}) {
100+ print STDERR "no man page for $_\n" if $report_errors;
101+ $errors += 1;
102+ }
103+}
104+
105+exit ($report_errors and $errors != 0);