From 0d2c9e0836f25efcb8fd796bdae5345afaa1e2a3 Mon Sep 17 00:00:00 2001 From: doogie <> Date: Sun, 28 Mar 2004 06:02:45 -0800 Subject: [PATCH] [project @ 2004-03-28 06:02:45 by doogie] Add support for reading compressed .log files. --- cgi/bugreport.cgi | 9 ++++++++- cgi/common.pl | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) 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; -- 2.39.5