Modifications to portindex so that links to both Y2k Statements and WWW sites are

included as part of its output...

Changes to Makefile also committed to reflect that portindex now looks for
three args vs just one ... the Y2k stuff is easy to rip out after the "scare" if
finished, as its only about 10 lines of easy to identify code...
This commit is contained in:
Marc G. Fournier 1999-03-11 20:16:05 +00:00
parent 677e582e58
commit 6b0622eb5f
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=4507
2 changed files with 42 additions and 5 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.17 1999-03-11 19:42:24 scrappy Exp $
# $Id: Makefile,v 1.18 1999-03-11 20:16:05 scrappy Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -50,6 +50,6 @@ Makefile.gen: index.sgml .NOTMAIN
index.sgml: ${INDEX} ${Y2K} ${WWW} packages.exists portindex ports.inc .NOTMAIN
rm -f *.sgml
${PORTINDEX} ${INDEX}
${PORTINDEX} ${INDEX} {$Y2K} ${WWW}
.include "../web.mk"

View file

@ -14,7 +14,6 @@
$config = $0 . '.' . 'conf';
do $config if -f $config;
# This is the base of where we ftp stuff from
if ($ENV{'MASTER_FTP_SERVER'}) {
$ftpserver = $ENV{'MASTER_FTP_SERVER'};
@ -42,8 +41,37 @@ $today = &getdate;
&packages_exist('packages.exists', *packages);
&category_description('categories', *category_description);
&y2k_statements;
&www_sites;
&main;
sub y2k_statements {
open(Y2K, $ARGV[1]);
while(<Y2K>) {
chop();
( $dir, $url ) = split(/\s+/);
$dir = $base . "/" . $dir;
$y2k{$dir} = $url;
}
close(Y2K);
}
sub www_sites {
open(WWW, $ARGV[2]);
while(<WWW>) {
chop();
( $dir, $url ) = split(/\s+/);
$dir = $base . "/" . $dir;
$www{$dir} = $url;
}
close(WWW);
}
sub getdate {
@months = ("January", "February", "March", "April", "May","June",
"July", "August", "September", "October", "November", "December");
@ -115,7 +143,8 @@ sub main {
$sep = "<B>:</B>";
while (<>) {
open(INDEX, $ARGV[0]);
while (<INDEX>) {
chop;
s/&/&amp;/g;
s/</&lt;/g;
@ -155,6 +184,14 @@ sub main {
$data{$i} .= qq{ | <A HREF="$pds?$sourcepath">Sources</A>};
if ($y2k{"$loc"}) {
$data{$i} .= qq{ | <a href="$y2k{$loc}">Y2K</a>};
}
if ($www{"$loc"}) {
$data{$i} .= qq{ | <a href="$www{$loc}">Main Web Site</a>};
}
$ownerurl = $owner;
$ownerurl =~ s/&lt;/</g;
$owenrurl =~ s/&gt;/>/g;
@ -258,5 +295,5 @@ browse the following categories:\n";
print MINDEX "</P>";
&footer(MINDEX, "<HR><A HREF=\"index.html\">Port Categories</A><HR>");
close(MINDEX);
close(INDEX);
}