From: Willi Mann <willi@wm1.at>
Date: Sat, 13 Aug 2011 14:26:39 +0200
Subject: 02-bug536472-treat-compressed-logfiles-always-as-archive.diff

---
 scripts/logwatch.pl |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/scripts/logwatch.pl b/scripts/logwatch.pl
index e4453b6..25e190c 100755
--- a/scripts/logwatch.pl
+++ b/scripts/logwatch.pl
@@ -725,7 +725,16 @@ foreach $LogFile (@LogFileList) {
 	}
 
    @FileList = $TempDir . $LogFile . "-archive";
-   push @FileList, @{$LogFileData{$LogFile}{'logfiles'}};
+   #quick and dirty fix for debian bug #536472:
+   #move logfiles ending with *.gz or *.bz2 to archive list, 
+   #so they are unpacked before being processed
+   foreach my $lf (@{$LogFileData{$LogFile}{'logfiles'}}) {
+      if($lf =~ /\.gz$|\.bz2$/) {
+         push @{$LogFileData{$LogFile}{'archives'}}, $lf;
+      } else {
+         push @FileList, $lf;
+      }
+   }
    my $DestFile =  $TempDir . $LogFile . "-archive";
    my $Archive;
    foreach $Archive (@{$LogFileData{$LogFile}{'archives'}}) {
-- 
