Load local config file portindex.conf if exists. 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.
This commit is contained in:
parent
f621522e9e
commit
3abbc2802a
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=3402
1 changed files with 21 additions and 5 deletions
|
@ -7,11 +7,27 @@
|
|||
|
||||
############################################################
|
||||
|
||||
# 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
|
||||
$base = "ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current";
|
||||
$baseHTTP = "ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current";
|
||||
$urlcgi = 'http://www.freebsd.org/cgi/url.cgi';
|
||||
$packagesURL = 'ftp://ftp.freebsd.org/pub/FreeBSD/packages-stable/All/';
|
||||
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/packages-stable/All/"
|
||||
if !$packagesURL;
|
||||
# support tar on the fly or gzip'ed tar on the fly
|
||||
$ftparchive = 'tar' if !$ftparchive;
|
||||
|
||||
# better layout and link to the sources
|
||||
if ($urlcgi) {
|
||||
|
@ -100,7 +116,7 @@ sub main {
|
|||
$ldesc =~ s/\/usr/$baseHTTP/;
|
||||
|
||||
# The name description and maintainer
|
||||
$data{$i} .= "<DT><B><A NAME=\"$name\"></A><A HREF=\"$loc.tar\">$name</A></B> ";
|
||||
$data{$i} .= "<DT><B><A NAME=\"$name\"></A><A HREF=\"$loc.$ftparchive\">$name</A></B> ";
|
||||
|
||||
|
||||
$data{$i} .= "<DD>$desc<BR><A HREF=\"$ldesc\">Long description</A>";
|
||||
|
|
Loading…
Reference in a new issue