You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <co...@decus.org> on 1997/06/28 08:07:50 UTC

[PATCH] to apache-site/dyn/closer.cgi for enhancements

    At last!  cvs diff managed to get something from taz!

    The closer.cgi script generates some fairly alarming HTML (such as
    newlines embedded in HREF values); this fixes that.  It also
    provides for a fifth field in the mirrors.list file; if present,
    it's interpreted as a comment (such as a geographic location) and
    displayed next to the link in parens, such as

      http://www.apache.org/dist/ (Under the Bay, Ca, USA)

    (it isn't part of the anchor).  If the fifth field isn't there, the
    display looks just like it does now.

    To make this work, I had to restrict the field delimiter to actual
    hard tabs, not just whitespace.

    #ken    :-)}

Index: closer.cgi
===================================================================
RCS file: /export/home/cvs/apache-site/dyn/closer.cgi,v
retrieving revision 1.3
diff -c -r1.3 closer.cgi
*** closer.cgi	1997/06/14 20:39:47	1.3
--- closer.cgi	1997/06/28 06:36:55
***************
*** 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>