Determine the size of ports.tar.gz automagically.

Reviewed and approved by:	tobez, simon
This commit is contained in:
Sergey A. Osokin 2005-11-15 10:09:26 +00:00
parent 4120f56d6b
commit f614b5f741
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=26350
3 changed files with 26 additions and 5 deletions

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/ports/Makefile,v 1.40 2005/10/18 03:45:12 linimon Exp $
# $FreeBSD: www/en/ports/Makefile,v 1.41 2005/10/18 12:24:12 edwin Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -62,7 +62,17 @@ Makefile.gen: index.sgml .NOTMAIN
${ECHO_CMD} NO_TIDY=${NO_TIDY} >> Makefile.gen
.endif
index.sgml: ${INDEX} categories categories.descriptions packages.exists portindex ports.inc .NOTMAIN
PORTS_TARGZ_URL?= ftp://ftp-master.FreeBSD.org/pub/FreeBSD/ports/ports/ports.tar.gz
ports.size:
.if defined (NOPORTSNET)
touch ${.TARGET}
.else
${RM} -f ${.TARGET}
${FETCH} -s ${PORTS_TARGZ_URL} > ${.TARGET}
.endif
index.sgml: ${INDEX} categories categories.descriptions packages.exists portindex ports.inc ports.size .NOTMAIN
${RM} -f *.sgml
${PORTINDEX} ${INDEX} ${.CURDIR}

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/ports/Makefile.inc,v 1.5 2001/01/04 22:12:42 wosch Exp $
# $FreeBSD: www/en/ports/Makefile.inc,v 1.6 2001/06/14 03:09:56 dd Exp $
PORTINDEX= ${PERL} ${.CURDIR}/portindex
INDEX= INDEX
@ -10,6 +10,7 @@ CLEANFILES+= ${INDEX}
CLEANFILES+= packages.exists.temp packages.exists
CLEANFILES+= ${DOCS}
CLEANFILES+= Makefile.gen
CLEANFILES+= ports.size
_ALLINSTALL= packages.exists ${INDEX} categories

View file

@ -4,7 +4,7 @@
#
# by John Fieber <jfieber@FreeBSD.org>
# Mon May 13 10:31:58 EST 1996
# $FreeBSD: www/en/ports/portindex,v 1.52 2005/10/04 19:43:49 hrs Exp $
# $FreeBSD: www/en/ports/portindex,v 1.53 2005/10/18 03:45:12 linimon Exp $
############################################################
@ -267,6 +267,13 @@ sub main {
$portnumber++;
}
my $ptgzsize = `cat ports.size 2>/dev/null` || "";
if ($ptgzsize =~ /^\d+$/) {
$ptgzsize = sprintf("%.0f", $ptgzsize/(1024*1024));
} else {
warn "Unknown size for ports.tar.gz\n";
}
$moutf->open(">index.sgml");
header($moutf, "FreeBSD Ports");
@ -278,7 +285,10 @@ sub main {
<P>There are currently $portnumber ports in the FreeBSD Ports Collection.<BR>
You may
<A HREF="$baseFTP/ports.tar.gz">download a gzip'd tar file of all ports</A>
(about 30 megabytes), view the
EOF
print $moutf "(about $ptgzsize megabytes)" if ($ptgzsize =~ /^\d+$/);
print $moutf <<EOF;
, view the
<A HREF=\"master-index.html\">alphabetical list of all ports</A>,
or browse the ports in the following categories:
<A NAME=\"categories\"></A>