=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 1.2 retrieving revision 1.6 diff -u -p -r1.2 -r1.6 --- cvsweb/cvsweb.cgi 1996/09/29 02:19:30 1.2 +++ cvsweb/cvsweb.cgi 1997/04/30 07:35:11 1.6 @@ -366,6 +366,18 @@ if (-d $fullname) { for ($i = 0; $i <= $#revorder; $i++) { $_ = $revorder[$i]; + print ""; + foreach $sym (split(", ", $revsym{$_})) { + print ""; + } + ($br = $_) =~ s/\.\d+$//; + if ($revsym{$br} && !$nameprinted{$br}) { + foreach $sym (split(", ", $revsym{$br})) { + print ""; + } + $nameprinted{$br}++; + } + print "\n"; # print "RCS revision $_\n"; print "$_"; if (/^1\.1\.1\.\d+$/) { @@ -380,7 +392,7 @@ if (-d $fullname) { # print "CVS Tags: $revsym{$_}
\n"; print "
CVS Tags: $revsym{$_}"; } - if (($br = $_) =~ s/\.\d+$// && $revsym{$br}) { + if ($revsym{$br}) { # print "Branch: $revsym{$br}
\n"; if ($revsym{$_}) { print "; "; @@ -457,7 +469,18 @@ if (-d $fullname) { print &html_footer; print "\n"; } else { - &fatal("404 Not Found","$where: no such file or directory"); + # Assume it's a module name with a potential path following it. + $where =~ s|/.*||; + $xtra = $&; + # Is there an indexed version of modules? + if (open(MODULES, "$cvsroot/CVSROOT/modules")) { + while () { + if (/^${where}\s+(\S+)/o && -d "${cvsroot}/$1" && ($1 ne $where)) { + &redirect($scriptname . '/' . $1 . $xtra); + } + } + } + &fatal("404 Not Found","$where$xtra: no such file or directory"); } sub htmlify { @@ -482,7 +505,7 @@ sub revcmp { local(@r2) = split(/\./, $rev2); local($a,$b); - while (($a = pop(@r1)) && ($b = pop(@r2))) { + while (($a = shift(@r1)) && ($b = shift(@r2))) { if ($a != $b) { return $a <=> $b; } @@ -499,5 +522,15 @@ sub fatal { print "\n"; print "Error\n"; print "Error: $errmsg\n"; + exit(1); +} + +sub redirect { + local($url) = @_; + print "Status: 301 Moved\n"; + print "Location: $url\n"; + print "\n"; + print "Moved\n"; + print "This document is located here.\n"; exit(1); }