From 6b0622eb5fa22ff316f686ab89eac0ba70a9b372 Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Thu, 11 Mar 1999 20:16:05 +0000 Subject: [PATCH] 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... --- en/ports/Makefile | 4 ++-- en/ports/portindex | 43 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/en/ports/Makefile b/en/ports/Makefile index bbaa9de5ae..f268bf497a 100644 --- a/en/ports/Makefile +++ b/en/ports/Makefile @@ -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" diff --git a/en/ports/portindex b/en/ports/portindex index b542c28b0f..fcfaf53c8e 100755 --- a/en/ports/portindex +++ b/en/ports/portindex @@ -13,7 +13,6 @@ # URL point to yourself and not to the standard FreeBSD FTP server. $config = $0 . '.' . 'conf'; do $config if -f $config; - # This is the base of where we ftp stuff from if ($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() { + chop(); + ( $dir, $url ) = split(/\s+/); + $dir = $base . "/" . $dir; + $y2k{$dir} = $url; + + } + close(Y2K); + +} + +sub www_sites { + + open(WWW, $ARGV[2]); + while() { + 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 = ":"; - while (<>) { + open(INDEX, $ARGV[0]); + while () { chop; s/&/&/g; s/Sources}; + if ($y2k{"$loc"}) { + $data{$i} .= qq{ | Y2K}; + } + + if ($www{"$loc"}) { + $data{$i} .= qq{ | Main Web Site}; + } + $ownerurl = $owner; $ownerurl =~ s/<//g; @@ -258,5 +295,5 @@ browse the following categories:\n"; print MINDEX "

"; &footer(MINDEX, "
Port Categories
"); close(MINDEX); - + close(INDEX); }