version 1.22, 1998/08/13 10:35:26 |
version 1.27, 1998/12/30 19:31:43 |
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# SUCH DAMAGE. |
# SUCH DAMAGE. |
# |
# |
# $fId: cvsweb.cgi,v 1.21 1998/07/23 09:42:40 wosch Exp $ |
# $fId: cvsweb.cgi,v 1.26 1998/11/10 19:26:16 motoyuki Exp $ |
# |
# |
|
|
|
|
Line 62 require 'cgi-style.pl'; |
|
Line 62 require 'cgi-style.pl'; |
|
%CVSROOT = ( |
%CVSROOT = ( |
'freebsd', '/home/ncvs', |
'freebsd', '/home/ncvs', |
'learn', '/c/learncvs', |
'learn', '/c/learncvs', |
'mozilla', '/a/mozilla-cvs', |
|
); |
); |
|
|
%CVSROOTdescr = ( |
%CVSROOTdescr = ( |
'freebsd', 'FreeBSD', |
'freebsd', 'FreeBSD', |
'learn', 'Learn', |
'learn', 'Learn', |
'mozilla', 'Mozilla FreeBSD', |
|
); |
); |
|
|
|
%mirrors = ( |
|
'Germany', 'http://www.de.freebsd.org/cgi/cvsweb.cgi', |
|
'Japan', 'http://www.jp.freebsd.org/cgi/cvsweb.cgi', |
|
); |
|
|
$cvstreedefault = 'freebsd'; |
$cvstreedefault = 'freebsd'; |
$cvstree = $cvstreedefault; |
$cvstree = $cvstreedefault; |
$cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs"; |
$cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs"; |
Line 144 if (!-d $cvsroot) { |
|
Line 147 if (!-d $cvsroot) { |
|
{ |
{ |
local(@foo, $i); |
local(@foo, $i); |
local($scriptname) = $ENV{'SCRIPT_NAME'}; |
local($scriptname) = $ENV{'SCRIPT_NAME'}; |
foreach (keys %CVSROOT) { |
foreach (sort keys %CVSROOT) { |
if (-d $CVSROOT{$_}) { |
if (-d $CVSROOT{$_}) { |
push(@foo, $_); |
push(@foo, $_); |
} |
} |
} |
} |
if ($#foo > 1) { |
if ($#foo > 1) { |
$intro .= "<p>\nThis script support the following CVS trees:\n"; |
$intro .= "<p>\nThis script supports the following CVS trees:\n"; |
for($i = 0; $i <= $#foo; $i++) { |
for($i = 0; $i <= $#foo; $i++) { |
$intro .= qq{<a href="$scriptname?cvsroot=$foo[$i]">} . |
$intro .= qq{<a href="$scriptname?cvsroot=$foo[$i]">} . |
($CVSROOTdescr{$foo[$i]} ? |
($CVSROOTdescr{$foo[$i]} ? |
Line 161 if (!-d $cvsroot) { |
|
Line 164 if (!-d $cvsroot) { |
|
} |
} |
|
|
|
|
|
{ |
|
local(@mirrors) = sort keys %mirrors;; |
|
if ($#mirrors >= 0) { |
|
$intro .= "<p>\nThis script is mirrored in:\n"; |
|
local($m); |
|
for($m = 0; $m <= $#mirrors; $m++) { |
|
$intro .= qq(<a href="$mirrors{$mirrors[$m]}">$mirrors[$m]</a>); |
|
$intro .= ',' if $m != $#mirrors; |
|
$intro .= "\n"; |
|
} |
|
} |
|
} |
|
|
|
|
if (-d $fullname) { |
if (-d $fullname) { |
opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!"); |
opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!"); |
@dir = readdir(DIR); |
@dir = readdir(DIR); |
|
|
$string =~ s/>/>/g; |
$string =~ s/>/>/g; |
|
|
if ($pr) { |
if ($pr) { |
$string =~ s|\bpr(\W+[a-z]+/\W*)(\d+)|<A HREF=/cgi/query-pr.cgi?pr=$2>$&</A>|ig; |
$string =~ s|\bpr(\W+[a-z]+/\W*)(\d+)|<A HREF=/cgi/query-pr.cgi?pr=$2>$&</A>|ig || |
|
$string =~ s|\bpr[:#]?\s*#?(\d+)\b|<A HREF=/cgi/query-pr.cgi?pr=$1>$&</A>|ig || |
|
$string =~ s!\b(bin|conf|docs|gnu|i386|kern|misc|ports)\/(\d+)\b!<A HREF=/cgi/query-pr.cgi?pr=$2>$&</A>!ig; |
} |
} |
|
|
$string; |
$string; |