===================================================================
RCS file: /cvs/cvsweb/cvsweb.cgi,v
retrieving revision 1.1.1.22
retrieving revision 1.1.1.27
diff -u -p -r1.1.1.22 -r1.1.1.27
--- cvsweb/cvsweb.cgi 2001/01/14 08:49:27 1.1.1.22
+++ cvsweb/cvsweb.cgi 2001/07/06 09:54:57 1.1.1.27
@@ -42,8 +42,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $zId: cvsweb.cgi,v 1.105 2000/11/26 01:51:04 jumager Exp $
-# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.64 2001/01/13 07:48:09 knu Exp $
+# $zId: cvsweb.cgi,v 1.110 2001/06/29 09:29:36 hnordstrom Exp $
+# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.78 2001/07/06 09:49:01 knu Exp $
#
###
@@ -85,7 +85,7 @@ use vars qw (
$tabstop $state $annTable $sel $curbranch @HideModules
$module $use_descriptions %descriptions @mytz $dwhere $moddate
$use_moddate $has_zlib $gzip_open
- $allow_tar @tar_options @gzip_options @cvs_options
+ $allow_tar @tar_options @gzip_options @zip_options @cvs_options
$LOG_FILESEPARATOR $LOG_REVSEPARATOR
);
@@ -139,9 +139,9 @@ sub forbidden_module($);
##### Start of Configuration Area ########
delete $ENV{PATH};
-$cvsweb_revision = join('.', '1.105', (split(/ /,
- q$Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.64 2001/01/13 07:48:09 knu Exp $
-))[2]);
+$cvsweb_revision = '1.110' . '.' . (split(/ /,
+ q$Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.78 2001/07/06 09:49:01 knu Exp $
+))[2];
use File::Basename;
@@ -170,7 +170,7 @@ $allow_version_select = 1;
# These are defined to allow checking with perl -cw
@CVSrepositories = @CVSROOT = %CVSROOT =
%MIRRORS = %DEFAULTVALUE = %ICONS = %MTYPES =
-%tags = %alltags = @tabcolors = ();
+%tags = %alltags = @tabcolors = %fileinfo = ();
$cvstreedefault = $body_tag = $body_tag_for_src =
$logo = $defaulttitle = $address =
$long_intro = $short_instruction = $shortLogLen =
@@ -309,9 +309,7 @@ if (-f $config) {
} else {
&fatal("500 Internal Error",
'Configuration not found. Set the variable $config
'
- . 'in cvsweb.cgi, or the environment variable '
- . 'CVSWEB_CONFIG
, to your cvsweb.conf '
- . 'configuration file first.');
+ . 'in cvsweb.cgi to your cvsweb.conf configuration file first.');
}
undef %input;
@@ -520,7 +518,8 @@ if ($input{tarball}) {
&fatal("403 Forbidden", "Downloading tarballs is prohibited.")
unless $allow_tar;
my($module) = ($where =~ m,^/?(.*),); # untaint
- $module =~ s,/[^/]*$,,;
+ $module =~ s,/([^/]*)$,,;
+ my($ext) = ($1 =~ /(\.tar\.gz|\.zip)$/);
my($basedir) = ($module =~ m,([^/]+)$,);
if ($basedir eq '' || $module eq '') {
@@ -532,30 +531,34 @@ if ($input{tarball}) {
mkdir($tmpdir, 0700)
or &fatal("500 Internal Error", "Unable to make temporary directory: $!");
- my $fatal = '';
+ my @fatal;
- while (1) {
- my $tag = (exists $input{only_with_tag} && length $input{only_with_tag})
- ? $input{only_with_tag} : "HEAD";
+ my $tag = (exists $input{only_with_tag} && length $input{only_with_tag})
+ ? $input{only_with_tag} : "HEAD";
- system $CMD{cvs}, @cvs_options, '-Qd', $cvsroot, 'export', '-r', $tag, '-d', "$tmpdir/$basedir", $module
- and $fatal = "500 Internal Error","cvs co failure: $!: $module"
- && last;
-
+ if (system $CMD{cvs}, @cvs_options, '-Qd', $cvsroot, 'export', '-r', $tag, '-d', "$tmpdir/$basedir", $module) {
+ @fatal = ("500 Internal Error", "cvs co failure: $!: $module");
+ } else {
$| = 1; # Essential to get the buffering right.
- print "Content-type: application/x-gzip\r\n\r\n";
+ if ($ext eq '.tar.gz') {
+ print "Content-type: application/x-gzip\r\n\r\n";
- system "$CMD{tar} @tar_options -cf - -C $tmpdir $basedir | $CMD{gzip} @gzip_options -c"
- and $fatal = "500 Internal Error","tar zc failure: $!: $basedir"
- && last;
+ system "$CMD{tar} @tar_options -cf - -C $tmpdir $basedir | $CMD{gzip} @gzip_options -c"
+ and @fatal = ("500 Internal Error", "tar zc failure: $!: $basedir");
+ } elsif ($ext eq '.zip' && $CMD{zip}) {
+ print "Content-type: application/zip\r\n\r\n";
- last;
+ system "cd $tmpdir && $CMD{zip} @zip_options -r - $basedir"
+ and @fatal = ("500 Internal Error", "zip failure: $!: $basedir");
+ } else {
+ @fatal = ("500 Internal Error", "unsupported file type");
+ }
}
system $CMD{rm}, '-rf', $tmpdir if -d $tmpdir;
- &fatal($fatal) if $fatal;
+ &fatal(@fatal) if @fatal;
exit;
}
@@ -750,10 +753,10 @@ if (-d $fullname) {
else {
print &link($backicon, $url);
}
- print " ", &link("Previous Directory", $url);
+ print " ", &link("Parent Directory", $url);
}
else {
- $url = urlencode($_) . "/$query";
+ $url = './' . urlencode($_) . "/$query";
print "";
if ($nofilelinks) {
print $diricon;
@@ -816,7 +819,7 @@ if (-d $fullname) {
}
elsif (s/,v$//) {
$fileurl = ($attic ? "Attic/" : "") . urlencode($_);
- $url = $fileurl . $query;
+ $url = './' . $fileurl . $query;
my $rev = '';
my $date = '';
my $log = '';
@@ -910,13 +913,19 @@ if (-d $fullname) {
if (defined($basefile) && $basefile ne '') {
print "
"; + while (<$filehandle>) { + print htmlquote($_); + } + print ""; } } @@ -1771,7 +1788,7 @@ sub doDiff($$$$$$) { while (($re1, $re2) = each %funcline_regexp) { if ($fullname =~ /$re1/) { - push @difftype, '-F', '$re2'; + push @difftype, '-F', $re2; last; } } @@ -2640,8 +2657,8 @@ sub human_readable_diff($){ print "
Line $oldline"; print " $funname |