--- doc/help/rebuildLabelHash.pl 2002/07/17 15:47:15 1.2 +++ doc/help/rebuildLabelHash.pl 2002/07/18 19:57:14 1.3 @@ -29,22 +29,28 @@ use strict; use GDBM_File; +use File::Spec; -my $dirprefix = "../../loncom/html/adm/help/"; +# I had to chdir, because neither glob nor bsd_glob accept globs +# with ".." in them... sucky. +chdir "../../loncom/html/adm/help/"; # if the topic hash exists, kill it -unlink 'fragmentLabels.gdbm' if ( -e $dirprefix . 'fragmentTopics.gdbm' ); +unlink 'fragmentLabels.gdbm' if ( -e 'fragmentLabels.gdbm' ); +print "Wiped old fragmentLabels.gdbm.\n"; -tie (my %fragmentLabels, 'GDBM_File', $dirprefix . 'fragmentLabels.gdbm', 1, 0); +tie (my %fragmentLabels, 'GDBM_File', 'fragmentLabels.gdbm', 1, 0); my $error = 0; -chdir $dirprefix; +chdir "tex"; -while (<*.tex>) +foreach my $file ( glob("*.tex") ) { - my $file; - $file = $_; open F, $file; + if ( index($file, "/") != "/" ) + { + $file = substr($file, index($file, "/") + 1); + } my $contents = join("\n", ); my $label;