Index: head/en_US.ISO8859-1/htdocs/cgi/ports.cgi
===================================================================
--- head/en_US.ISO8859-1/htdocs/cgi/ports.cgi (revision 50992)
+++ head/en_US.ISO8859-1/htdocs/cgi/ports.cgi (revision 50993)
@@ -1,634 +1,634 @@
#!/usr/bin/perl -T
#
# Copyright (c) 1996-2017 Wolfram Schneider
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
#
# ports.cgi - search engine for FreeBSD ports
# o search for a port by name or description
use POSIX qw(strftime);
use Time::Local;
require "./cgi-style.pl";
$t_style = qq`
-
+
`;
sub init_variables {
$localPrefix = '/usr/ports'; # ports prefix
# Directory of the up-to-date INDEX*
$portsDatabaseHeadDir = "/usr/local/www/ports";
# Ports database file to use
if ( -f "$portsDatabaseHeadDir/INDEX-12" ) {
$ports_database = 'INDEX-12';
}
elsif ( -f "$portsDatabaseHeadDir/INDEX-11" ) {
$ports_database = 'INDEX-11';
}
else {
$ports_database = 'INDEX';
}
# URL of ports tree for browsing
$remotePrefixFtp = 'ports';
# 'ftp://ftp.FreeBSD.org/pub/FreeBSD/branches/-current/ports';
# where to get -current packages
local ($p) = 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386';
local ($palpha) = 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/alpha';
local ($pamd64) = 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/amd64';
local ($pia64) = 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/ia64';
local ($psparc64) = 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/sparc64';
$remotePrefixFtpPackagesDefault = '6-STABLE/i386';
# This is currently unused
%remotePrefixFtpPackages = (
'7-CURRENT/i386', "$p/packages-7-current/All",
'6-STABLE/i386', " $p/packages-6-stable/All",
'5-STABLE/i386', " $p/packages-5-stable/All",
'4-STABLE/i386', " $p/packages-4-stable/All",
'6.0-RELEASE/i386', "$p/packages-6.0-release/All",
'5.4-RELEASE/i386', "$p/packages-5.4-release/All",
'4.11-RELEASE/i386', "$p/packages-4.11-release/All",
'4-STABLE/alpha', "$palpha/packages-4-stable/All",
'5.4-RELEASE/alpha', "$palpha/packages-5.4-release/All",
'4.11-RELEASE/alpha', "$palpha/packages-4.11-release/All",
'7-CURRENT/amd64', "$pamd64/packages-7-current/All",
'6-STABLE/amd64', "$pamd64/packages-6-stable/All",
'5-STABLE/amd64', "$pamd64/packages-5-stable/All",
'6.0-RELEASE/amd64', "$pamd64/packages-6.0-release/All",
'5.4-RELEASE/amd64', "$pamd64/packages-5.4-release/All",
'7-CURRENT/ia64', "$pia64/packages-7-current/All",
'6-STABLE/ia64', "$pia64/packages-6-stable/All",
'6.0-RELEASE/ia64', "$pia64/packages-6.0-release/All",
'5.4-RELEASE/ia64', "$pia64/packages-5.4-release/All",
'7-CURRENT/sparc64', "$psparc64/packages-7-current/All",
'6-STABLE/sparc64', "$psparc64/packages-6-stable/All",
'5-STABLE/sparc64', "$psparc64/packages-5-stable/All",
'6.0-RELEASE/sparc64', "$psparc64/packages-6.0-release/All",
'5.4-RELEASE/sparc64', "$psparc64/packages-5.4-release/All",
);
$remotePrefixHtml = "$hsty_base/ports";
# CVS Web interface
$remotePrefixCvs = 'http://svnweb.FreeBSD.org/ports/head';
# Ports documentation
$portsDesc = "$hsty_base/ports/";
# location of the tiny BSD daemon
$daemonGif =
"";
# visible E-Mail address, plain text
$mailto = 'www@FreeBSD.org';
# Mailinglist for FreeBSD Ports
$mailtoList = 'ports@FreeBSD.org';
# use mailto:email?subject
$mailtoAdvanced = 'yes';
# the URL if you click at the E-Mail address (see below)
$mailtoURL = "mailto:$mailto" if !$mailtoURL;
# security
$ENV{'PATH'} = '/bin:/usr/bin';
# extension type for packages
$packageExt = 'tbz';
local ($packageDB) = '../ports/packages.exists';
&packages_exist( $packageDB, *packages ) if -f $packageDB;
}
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;
}
# return the date of the last ports database update
sub last_update {
local ($file) = "$portsDatabaseHeadDir/$ports_database";
local ( $modtime, $modtimestr );
$modtime = ( stat($file) )[9];
if ( defined($modtime) && $modtime > 0 ) {
$modtimestr = strftime( "%G-%m-%d %H:%M:%S UTC", gmtime($modtime) );
}
else {
$modtimestr = "Unknown";
}
return $modtimestr;
}
sub last_update_message {
return "
FreeBSD Ports [short description followed ...]
FAQ
};
print qq{
"Package Name" searches for the name of a port or distribution.
"Description" searches case-insensitive in a short comment about the port.
"All" searches case-insensitive for the package name and in the
description about the port.