diff --git a/es/ports/Makefile b/es/ports/Makefile index c3bd1281d8..a5b0e117a6 100644 --- a/es/ports/Makefile +++ b/es/ports/Makefile @@ -1,60 +1,52 @@ -# $FreeBSD: www/es/ports/Makefile,v 1.7 1999/11/15 20:37:56 jesusr Exp $ +# $FreeBSD: www/es/ports/Makefile,v 1.8 2000/11/29 23:56:58 kuriyama Exp $ .if exists(../Makefile.conf) .include "../Makefile.conf" .endif .if exists(../Makefile.inc) .include "../Makefile.inc" .endif .if exists(Makefile.inc) .include "Makefile.inc" .endif .if defined(NOPORTSCVS) ${INDEX}: $${PORTSBASE}/${PINDEX} cp ${PORTSBASE}/${PINDEX} ${INDEX} - -${Y2K}: $${PORTSBASE}/${PY2K} - cp ${PORTSBASE}/${PY2K} ${Y2K} - .else ${INDEX}: ${cvsindex} cvs -QR co -p ${PINDEX} > ${INDEX} - -${Y2K}: ${cvsy2k} - cvs -QR co -p ${PY2K} > ${Y2K} - .endif # build the list of available packages only on the # main FreeBSD machines hostname!= hostname .if defined(NOPORTSCVS) packages.exists: .else -packages.exists: ${cvsindex} ${cvsy2k} +packages.exists: ${cvsindex} .endif .if ${hostname} == "hub.freebsd.org" || ${hostname} == "freefall.freebsd.org" .if exists(${.CURDIR}/../../en/ports/packages.exists) cp ${.CURDIR}/../../en/ports/${.TARGET} . .else sh ${.CURDIR}/packages > ${.TARGET} .endif .else touch ${.TARGET} .endif Makefile.gen: index.sgml .NOTMAIN echo DOCS= *.sgml > Makefile.gen -index.sgml: ${INDEX} ${Y2K} packages.exists portindex ports.inc .NOTMAIN +index.sgml: ${INDEX} packages.exists portindex ports.inc .NOTMAIN rm -f *.sgml - ${PORTINDEX} ${INDEX} ${Y2K} ${.CURDIR} + ${PORTINDEX} ${INDEX} ${.CURDIR} install: all all install clean: (cd ${.CURDIR} &&${MAKE} ${MAKEFLAGS} -f ${.CURDIR}/Makefile.inc0 ${.TARGET}) .include "${WEB_PREFIX}/share/mk/web.site.mk" diff --git a/es/ports/Makefile.inc b/es/ports/Makefile.inc index 8b839d9dd1..6758dc1ad9 100644 --- a/es/ports/Makefile.inc +++ b/es/ports/Makefile.inc @@ -1,20 +1,16 @@ PORTINDEX= perl5 ${.CURDIR}/portindex INDEX= INDEX PINDEX= ports/${INDEX} -Y2K= YEAR2000 -PY2K= ports/${Y2K} COOKIE= ${INDEX} Makefile.gen CLEANFILES+= ${INDEX} -CLEANFILES+= ${Y2K} CLEANFILES+= packages.exists.temp packages.exists CLEANFILES+= ${DOCS} CLEANFILES+= Makefile.gen cvsindex= $${CVSROOT}/${PINDEX},v -cvsy2k= $${CVSROOT}/${PY2K},v -_ALLINSTALL= packages.exists ${INDEX} ${Y2K} +_ALLINSTALL= packages.exists ${INDEX} diff --git a/es/ports/portindex b/es/ports/portindex index 900f324ac2..2058c8ed36 100755 --- a/es/ports/portindex +++ b/es/ports/portindex @@ -1,285 +1,266 @@ #!/usr/bin/perl # convert a ports INDEX file to HTML # # by John Fieber # Mon May 13 10:31:58 EST 1996 ############################################################ # Load local config file. You can override in portindex.conf # the variables for the default web and the ftp server. This # make it easy to maintain a local web mirror and let the # 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'}) { $ftpserver = $ENV{'MASTER_FTP_SERVER'}; } else { $ftpserver = 'ftp://ftp.freebsd.org' if !$ftpserver; } $base = "$ftpserver/pub/FreeBSD/FreeBSD-current" if !$base; $baseHTTP = $base if !$baseHTTP; $urlcgi = 'http://www.freebsd.org/cgi/url.cgi' if !$urlcgi; $packagesURL = "$ftpserver/pub/FreeBSD/ports/i386/packages-stable/All/" if !$packagesURL; # support tar on the fly or gzip'ed tar on the fly $ftparchive = 'tar' if !$ftparchive; # ports download sources script $pds = 'http://www.freebsd.org/cgi/pds.cgi'; # better layout and link to the sources if ($urlcgi) { $baseHTTP = $urlcgi . '?' . $baseHTTP; } $today = &getdate; &packages_exist('packages.exists', *packages); &category_description(($ARGV[2] || '.') . '/categories', *category_description); -&y2k_statements; &main; -sub y2k_statements { - - open(Y2K, $ARGV[1]); - while() { - chop(); - ( $dir, $url ) = split(/\s+/); - $dir = $base . "/" . $dir; - $y2k{$dir} = $url; - - } - close(Y2K); - -} - sub getdate { @months = ("January", "February", "March", "April", "May","June", "July", "August", "September", "October", "November", "December"); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year += 1900; return "Updated $months[$mon] $mday, $year"; } sub header { local ($fh, $htext) = @_; print $fh ""; print $fh "$today\">\n"; print $fh ""; print $fh "\n"; print $fh "\n"; print $fh ""; print $fh "%includes;\n"; print $fh "]>\n"; print $fh "&header;\n"; } sub footer { local ($fh, $ftext) = @_; print $fh "\n$ftext\n"; print $fh "&footer;\n"; print $fh "\n\n"; } sub packages_exist { local($file, *p) = @_; open(P, $file) || do { warn "open $file: $!\n"; warn "Cannot create packages links\n"; return 1; }; while(

) { chop; $p{$_} = 1; } close P; return 0; } sub category_description { local($file, *p) = @_; open(P, $file) || do { warn "open $file: $!\n"; warn "Cannot find category description\n"; return 1; }; local($category, $description); while(

) { # ignore comments next if /^\s*#/; ($category, $description) = /^\s*"([^"]+)",\s*"([^"]+)/; $p{$category} = $description; } close P; return 0; } sub main { $sep = ":"; open(INDEX, $ARGV[0]); while () { chop; s/&/&/g; s//>/g; # Read a record ($name, $loc, $prefix, $desc, $ldesc, $owner, $cats, $bdep, $rdep, $www) = split('\|'); # Check for double hyphens in the name (--). $name =~ s/--/-/g; # Split the categories into an array @cat = split("[ \t]+", $cats); $catkey{$name} = $cat[0]; local($sourcepath) = $loc; $sourcepath =~ s%/usr/%%; foreach $i (@cat) { $stats{$i}++; # figure out the FTP url $loc =~ s/\/usr/$base/; $ldesc =~ s/\/usr/$baseHTTP/; # The name description and maintainer $data{$i} .= "

$name "; $data{$i} .= "
$desc
Long description"; if ($packages{"$name.tgz"}) { $data{$i} .= qq{ | Package}; } $data{$i} .= qq{ | Sources}; - if ($y2k{"$loc"}) { - $data{$i} .= qq{ | Y2K}; - } - if ($www ne "") { $data{$i} .= qq{ | Main Web Site}; } $ownerurl = $owner; $ownerurl =~ s/<//g; $data{$i} .= "
Maintained by: $owner"; # If there are any dependencies, list them if ($bdep ne "" || $rdep ne "") { $data{$i} .= "
Requires: "; @dep = split(/ /, "$bdep $rdep"); local($last) = ''; foreach $j (sort @dep) { next if $j eq $last; $last = $j; $data{$i} .= " $j,"; } # remove the trailing comma chop $data{$i}; } # If the port is listed in more than one category, throw # in some cross references if ($#cat > 0) { $data{$i} .= "
Also listed in: "; foreach $j (@cat) { if ($j ne $i) { if ($j eq $cat[0]) { $data{$i} .= " \u$j,"; } else { $data{$i} .= " \u$j,"; } } } # remove the trailing comma chop($data{$i}); } $data{$i} .= "

\n" } # Add an entry to the master index # workaround for SGML bug, `--' is not allowed in comments local ($sname) = $name; $sname =~ s/--/-=/g; $master[$portnumber] = "$name " . " -- $desc
\n"; $portnumber++; } open(MOUTF, ">index.sgml"); &header(MOUTF, "FreeBSD Ports"); # print MOUTF "\n"; print MOUTF "&blurb;"; print MOUTF "

There are currently $portnumber ports in the FreeBSD Ports Collection.
Download a gzip'd tar file of all $portnumber ports (about 7 megabytes) or browse the following categories:\n"; print MOUTF "

\n"; print MOUTF "\n"; &footer(MOUTF, ""); close(MOUTF); # Create the master index file open(MINDEX, ">master-index.sgml"); &header(MINDEX, "FreeBSD Ports Collection Index"); print MINDEX "

\n"; print MINDEX sort @master; print MINDEX "

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