changeset 2993:6f68bff8dd2c octave-forge

Add test for duplication of functions in the INDEX files. Remove debugging print-out
author adb014
date Tue, 30 Jan 2007 20:24:34 +0000
parents 06e659ed8c4e
children 4a3d4245828e
files admin/make_index
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/admin/make_index	Tue Jan 30 15:57:59 2007 +0000
+++ b/admin/make_index	Tue Jan 30 20:24:34 2007 +0000
@@ -120,6 +120,8 @@
 my $n_functions = 0;
 my @shadow_paths = ('FIXES', 'extra/NaN', 'extra/Windows', 'extra/ver20'); 
 my @shadowed = ();
+my @duplicated = ();
+my %n_duplicated = ();
 
 # grab help from C++ files
 foreach my $f ( @C_files ) {
@@ -358,6 +360,13 @@
 #    print wrap("\t", "\t", join(" ", sort @shadowed)), "\n";
 }
 
+if (@duplicated) {
+    print "unexpected duplicate indexing of ", scalar(@duplicated), " functions";
+    my $rs = $,; $, = "\n  ";
+    print "  ", sort(@duplicated); $, = $rs;
+    print "\n";
+}
+
 sub process_docstrings {
   my $function = "";
   my $desc = "";
@@ -639,6 +648,10 @@
 	    die "Function $function (line $.) has no category" unless $category;
 	    push @{$index_by_TB_cat{$toolbox}{$category}}, $function;
 	    push @{$index_by_function{$function}}, [$toolbox, $category];
+	    ++$n_duplicated{$function};
+	    if ($n_duplicated{$function} > 1) {
+		push @duplicated, "$file:$function";
+	    }
 	} else {
             s/^\s+//;
             my @list = split /\s+/;
@@ -681,8 +694,6 @@
 	# The source file
 
 	my $body = long_desc($func);
-	print $body;
-	print "\n";
 	if ($body ne "") {
 	    # XXX FIXME XXX this will die if the punctuation is too wild
 	    open FUNC, ">$catdir/f/$func.in" or die "Could not open $func.in";