]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2004-03-28 06:02:45 by doogie]
authordoogie <>
Sun, 28 Mar 2004 14:02:45 +0000 (06:02 -0800)
committerdoogie <>
Sun, 28 Mar 2004 14:02:45 +0000 (06:02 -0800)
Add support for reading compressed .log files.

cgi/bugreport.cgi
cgi/common.pl

index 63419c343dc4854294f0762769dcb9bc0799ff65..fca381404fc0366257c8a0a7306080016eb40a68 100755 (executable)
@@ -239,7 +239,14 @@ foreach my $pkg (@tpacks) {
     $descriptivehead .= ".\n<br>";
 }
 
-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<p>Bug is <strong>archived</strong>. No further changes may be made.</p>";
 }
index 082eb2d978161ddc417f3cf6761f0652535be4d5..18b60cd492411a2f9102f5647716eedf51d05175 100644 (file)
@@ -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;