#!/usr/bin/perl # The contents of this file are subject to the Netscape Public # License Version 1.1 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.mozilla.org/NPL/ # # Software distributed under the License is distributed on an "AS # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or # implied. See the License for the specific language governing # rights and limitations under the License. # # The Original Code is the Netscape Mailstone utility, # released March 17, 2000. # # The Initial Developer of the Original Code is Netscape # Communications Corporation. Portions created by Netscape are # Copyright (C) 1997-2000 Netscape Communications Corporation. All # Rights Reserved. # # Contributor(s): Dan Christian # Marcel DePaolis # # Alternatively, the contents of this file may be used under the # terms of the GNU Public License (the "GPL"), in which case the # provisions of the GPL are applicable instead of those above. # If you wish to allow use of your version of this file only # under the terms of the GPL and not to allow others to use your # version of this file under the NPL, indicate your decision by # deleting the provisions above and replace them with the notice # and other provisions required by the GPL. If you do not delete # the provisions above, a recipient may use your version of this # file under either the NPL or the GPL. ##################################################### # usage: perl -Ibin makeindex.pl # Look at all the results files and create a top level index unless ($resultbase) { # pick up systematic defaults, if needed do 'args.pl'|| die $@; parseArgs(); # parse command line } ($testname = $params{WORKLOAD}) =~ s:conf/::; $testname =~ s:.wld::; my $entry = ""; $entry .= "
$params{TSTAMP}"; $entry .= "$testname\n"; $entry .= "$params{TITLE}\n"; $entry .= "$params{TIME}\n"; $entry .= "$params{CLIENTCOUNT}\n"; $entry .= "workload\n"; $entry .= "stderr\n"; if (-r "$resultbase/index.html") { fileInsertAfter ("$resultbase/index.html", "^ END print INDEXNEW $entry; # put in this entry # Add in any existing entries # get a list of all the results files @resall = <$resultbase/*/results.html>; # Write out all the links # This could be rather slow, but we only do it when index.html is missing foreach $filefull (reverse @resall) { my $file = $filefull; $file =~ s:$resultbase/::; if ($file eq $params{TSTAMP}) { next; } # written above my $dir = $file; $dir =~ s:/results.html::; # dont read in old workloads, it will override the current one print INDEXNEW "
$dir\n"; print INDEXNEW "    \n"; print INDEXNEW "workload\n"; print INDEXNEW "stderr\n"; } print INDEXNEW < END close (INDEXNEW); fileBackup ("$resultbase/index.html"); rename ("$resultbase/index.new", "$resultbase/index.html"); print "Created $resultbase/index.html\n"; } return 1;