From: doogie <>
Date: Sun, 28 Mar 2004 14:02:45 +0000 (-0800)
Subject: [project @ 2004-03-28 06:02:45 by doogie]
X-Git-Tag: release/2.6.0~756
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0d2c9e0836f25efcb8fd796bdae5345afaa1e2a3;p=debbugs.git
[project @ 2004-03-28 06:02:45 by doogie]
Add support for reading compressed .log files.
---
diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi
index 63419c34..fca38140 100755
--- a/cgi/bugreport.cgi
+++ b/cgi/bugreport.cgi
@@ -239,7 +239,14 @@ foreach my $pkg (@tpacks) {
$descriptivehead .= ".\n
";
}
-open L, "<$buglog" or &quitcgi("open log for $ref: $!");
+if ($buglog =~ m/\.gz$/) {
+ my $oldpath = $ENV{'PATH'};
+ $ENV{'PATH'} = '/bin:/usr/bin';
+ open L, "zcat $buglog |" or &quitcgi("open log for $ref: $!");
+ $ENV{'PATH'} = $oldpath;
+} else {
+ open L, "<$buglog" or &quitcgi("open log for $ref: $!");
+}
if ($buglog !~ m#^\Q$gSpoolDir/db#) {
$descriptivehead .= "\n
Bug is archived. No further changes may be made.
"; } diff --git a/cgi/common.pl b/cgi/common.pl index 082eb2d9..18b60cd4 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -837,8 +837,9 @@ sub getsrcpkgs { sub buglog { my $bugnum = shift; my $location = getbuglocation($bugnum, 'log'); - return undef unless defined $location; - return getbugcomponent($bugnum, 'log', $location); + return getbugcomponent($bugnum, 'log', $location) if ($location); + $location = getbuglocation($bugnum, 'log.gz'); + return getbugcomponent($bugnum, 'log.gz', $location); } my %_versionobj;