1 From d8a3da12be085fbc92e3d4d4d084c328fc37485a Mon Sep 17 00:00:00 2001
2 From: Willem Toorop <willem@nlnetlabs.nl>
3 Date: Thu, 27 Nov 2014 16:21:54 +0100
4 Subject: [PATCH] let doxyparse output manpage generation issues
6 [Backport from upstream commit
7 168ee09a4bf184947798c3ee3ac99b6651470d64, fixes the build with Perl
9 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
11 doc/doxyparse.pl | 45 ++++++++++++++++++++++++++++++++++++++-------
12 1 file changed, 38 insertions(+), 7 deletions(-)
14 diff --git a/doc/doxyparse.pl b/doc/doxyparse.pl
15 index 96a1732..a09b2e8 100755
16 --- a/doc/doxyparse.pl
17 +++ b/doc/doxyparse.pl
18 @@ -57,10 +57,15 @@ This manpage was automaticly generated from the ldns source code by
19 use of Doxygen and some perl.
22 -getopts("m:",\%options);
23 +getopts("em:",\%options);
24 # if -m manpage file is given process that file
25 # parse the file which tells us what manpages go together
26 my $functions, $see_also;
28 +my $report_errors = defined $options{'e'};
32 if (defined $options{'m'}) {
34 open(MAN, "<$options{'m'}") or die "Cannot open $options{'m'}";
35 @@ -68,18 +73,35 @@ if (defined $options{'m'}) {
36 # func1, func2, .. | see_also1, see_also2, ...
42 - ($functions, $see_also) = split /[\t ]*\|[\t ]*/, $_;
43 - #print "{$functions}\n";
44 - #print "{$see_also}\n";
45 + my @parts = split /[\t ]*\|[\t ]*/, $_;
46 + $functions = shift @parts;
47 + $see_also = join ', ', @parts;
48 + print "{$functions}\n";
49 + print "{$see_also}\n";
50 my @funcs = split /[\t ]*,[\t ]*/, $functions;
51 my @also = split /[\t ]*,[\t ]*/, $see_also;
52 $manpages{$funcs[0]} = \@funcs;
53 $see_also{$funcs[0]} = \@also;
56 + push $unique{$_}, ($i,);
61 #print "[", $funcs[0], "]\n";
64 + while (($func, $lines) = each %unique ) {
65 + if (scalar @$lines > 1) {
66 + print STDERR "$func in function_manpages on lines: "
67 + . join(", ",@$lines) . "\n" if $report_errors;
72 print "Need -m file to process the .h files\n";
74 @@ -95,7 +117,7 @@ mkdir "doc/man";
75 mkdir "doc/man/man$MAN_SECTION";
83 @@ -273,7 +295,7 @@ foreach (keys %manpages) {
85 print MAN $MAN_MIDDLE;
87 - if (defined(@$also)) {
89 print MAN "\n.SH SEE ALSO\n\\fI";
90 print MAN join "\\fR, \\fI", @$also;
91 print MAN "\\fR.\nAnd ";
92 @@ -290,7 +312,7 @@ foreach (keys %manpages) {
94 chdir("$BASE/man$MAN_SECTION");
96 - print STDERR $_,"\n";
97 + print STDOUT $_,"\n";
98 my $new_file = $_ . "." . $MAN_SECTION;
99 if ($new_file eq $symlink_file) {
101 @@ -301,3 +323,12 @@ foreach (keys %manpages) {
102 chdir("../../.."); # and back, tricky and fragile...
105 +foreach (keys %api) {
106 + next if (/ / || /^$/);
107 + if (not $unique{$_}) {
108 + print STDERR "no man page for $_\n" if $report_errors;
113 +exit ($report_errors and $errors != 0);