From: Eldy <el...@us...> - 2004-01-31 17:29:52
|
This mail is to report a bug in the new logrotate tool and provide the patch. When there is several log in the first line of a logrotate file (and this is possible according to logrotate doc), Webmin ignores the whole file. This is the patch to solve this. --- logrotate-lib.pl.old Sat Jan 31 18:24:12 2004 +++ logrotate-lib.pl Sat Jan 31 18:22:47 2004 @@ -38,16 +38,20 @@ while(<$fh>) { s/\r|\n//g; s/#.*$//; - if (/^\s*(\S+)\s*{\s*$/) { - # Start of a section - $section = { 'name' => $1, + if (/^\s*(.*)\s*{\s*$/) { + foreach my $logfile (split(/\s+/,$1)) { + if ($logfile) { + # Start of a section + $section = { 'name' => $logfile, 'members' => [ ], 'index' => scalar(@$addto), 'line' => $lnum, 'eline' => $lnum, 'file' => $file }; - push(@$addto, $section); - $addto = $section->{'members'}; + push(@$addto, $section); + $addto = $section->{'members'}; + } + } } elsif (/^\s*}\s*$/) { # End of a section -- Laurent Destailleur for AWStats, AWBot and CVSChangeLogBuilder. --------------------------------------------------------------- EMail: el...@us... AWStats : http://awstats.sourceforge.net AWBot : http://awbot.sourceforge.net CVSChangeLogBuilder : http://cvschangelogb.sourceforge.net |