coar 97/07/02 04:10:06
Modified: dyn closer.cgi Log: Add knowledge of fifth field in mirror list data file, which is a comment or geographical location to be displayed alongside the URL. Fields are now explicitly TAB-delimited, not whitespace- delimited, so that the comment field can contain spaces. If the comment field is empty, no additional info is displayed. Revision Changes Path 1.5 +17 -9 apache-site/dyn/closer.cgi Index: closer.cgi =================================================================== RCS file: /export/home/cvs/apache-site/dyn/closer.cgi,v retrieving revision 1.4 retrieving revision 1.5 diff -C3 -r1.4 -r1.5 *** closer.cgi 1997/06/28 17:11:00 1.4 --- closer.cgi 1997/07/02 11:10:05 1.5 *************** *** 24,33 **** $count = 0; while(<MIRRORS>) { ! @AR = split; if(($cc eq $AR[1] || $sld.".".$tld eq $AR[1]) && $AR[0] eq $method) { $LIST[$count] = $AR[2]; $count++; } } --- 24,35 ---- $count = 0; while(<MIRRORS>) { ! chomp; ! @AR = split (/\t/, $_); if(($cc eq $AR[1] || $sld.".".$tld eq $AR[1]) && $AR[0] eq $method) { $LIST[$count] = $AR[2]; + $LOC[$count] = $AR[4]; $count++; } } *************** *** 48,66 **** </H3> EOF ! print "<B><CENTER>"; while(1) { $url = $LIST[$i]; # $url .= "dist/" if $method eq "http"; ! print <<EOF; ! <A HREF="$url">$LIST[$i]</A><BR> ! EOF $i++; $i = 0 if $i >= $count; last if $i == $start; } ! print "</CENTER></B>"; } } --- 50,71 ---- </H3> EOF ! print "<CENTER>"; while(1) { $url = $LIST[$i]; # $url .= "dist/" if $method eq "http"; ! print "\n<A HREF=\"$url\"><STRONG>$LIST[$i]</STRONG></A>"; ! if ($LOC[$i]) { ! print " ($LOC[$i])"; ! } ! print "\n"; $i++; $i = 0 if $i >= $count; last if $i == $start; + print "<BR>"; } ! print "</CENTER>\n"; } } *************** *** 99,108 **** { print <<EOF; ! <P ALIGN=center>Use one of the sites above or see the <A ! HREF="../mirrors/">full listing of download sites</A>.</P> ! <P ALIGN=CENTER><B><A HREF="../info/how-to-mirror.html">How do I become an Apache mirror site?</A></B> <P><HR> --- 104,116 ---- { print <<EOF; ! <P ALIGN=center>Use one of the sites above or see the ! <A HREF="../mirrors/">full listing of download sites</A>.</P> ! <P ALIGN=CENTER> ! <STRONG><A ! HREF="../info/how-to-mirror.html" ! >How do I become an Apache mirror site?</A></STRONG> <P><HR>