From 338a878c6d485d7ddde80e4ebe8ca38f1addce9e Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Fri, 14 Mar 2003 08:19:26 +0000 Subject: [PATCH] Change the 'Download' link from ftp site (which is no longer there) to cvsweb.freebsd.org (tarball option). Submitted by: Kris Kennaway --- en/cgi/ports.cgi | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/en/cgi/ports.cgi b/en/cgi/ports.cgi index 7f175c9b69..0afb3e5dba 100755 --- a/en/cgi/ports.cgi +++ b/en/cgi/ports.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -T # -# Copyright (c) 1996-2002 Wolfram Schneider , Berlin. +# Copyright (c) 1996-2003 Wolfram Schneider # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD$ +# $FreeBSD: www/en/cgi/ports.cgi,v 1.64 2003/03/04 11:56:15 roam Exp $ # # ports.cgi - search engine for FreeBSD ports # o search for a port by name or description @@ -49,7 +49,8 @@ sub init_variables { # URL of ports tree for download $remotePrefixFtpDownload = - 'ftp://ftp.FreeBSD.org/pub/FreeBSD/branches/-current/ports'; + 'http://cvsweb.FreeBSD.org/ports'; + $remoteSuffixFtpDownload = '%s.tar.gz?tarball=1'; # where to get -current packages local($p) = 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386'; @@ -335,6 +336,14 @@ sub out { $path =~ s/^$localPrefix/$remotePrefixFtp/o; $pathDownload =~ s/^$localPrefix/$remotePrefixFtpDownload/o; + if ($remoteSuffixFtpDownload) { + if (substr($remoteSuffixFtpDownload, 0, 2) eq '%s') { + $pathDownload =~ m,([^/]+)+$,; + $pathDownload .= "/$1" . substr($remoteSuffixFtpDownload, 2); + } else { + $pathDownload .= $remoteSuffixFtpDownload; + } + } $descfile =~ s/^$localPrefix/$remotePrefixFtp/o; print qq{
$version\n}; @@ -575,7 +584,7 @@ sub footer { © 1996-2002 by Wolfram Schneider. All rights reserved.
}; - #print q{$FreeBSD$} . "
\n"; + #print q{$FreeBSD: www/en/cgi/ports.cgi,v 1.64 2003/03/04 11:56:15 roam Exp $} . "
\n"; print qq{Please direct questions about this service to $mailto
\n}; print qq{General questions about FreeBSD ports should be sent to } .