Blame SOURCES/logwatch-oldfiles.patch

aa46a8
Add '--no-oldfiles-log' option that suppresses a warning about old files in the
aa46a8
logwatch temporary directory.
aa46a8
aa46a8
Author: Ivana Varekova <varekova@redhat.com>
aa46a8
RH-Bugzilla: #230974
aa46a8
aa46a8
--- logwatch-20110113/logwatch.8.orig	2010-05-01 04:32:20.000000000 +0200
aa46a8
+++ logwatch-20110113/logwatch.8	2011-01-13 11:49:28.631589520 +0100
aa46a8
@@ -31,7 +31,7 @@
aa46a8
 .I report format
aa46a8
 .B ] [--encode
aa46a8
 .I encoding to use
aa46a8
-.B ] [--numeric] [--version] [--help|--usage]
aa46a8
+.B ] [--numeric] [--no-oldfiles-log] [--version] [--help|--usage]
aa46a8
 .SH DESCRIPTION
aa46a8
 .B Logwatch
aa46a8
 is a customizable, pluggable log-monitoring system.  It will go
aa46a8
@@ -104,6 +104,9 @@
aa46a8
 then only logs from this hostname will be processed (where appropriate).
aa46a8
 .IP "\fB--numeric\fR"
aa46a8
 Inhibits additional name lookups, displaying IP addresses numerically.
aa46a8
+.IP "\fB--no-oldfiles-log\fR"
aa46a8
+Suppress the logwatch log, which informs about the
aa46a8
+old files in logwatch tmpdir.
aa46a8
 .IP "\fB--usage\fR"
aa46a8
 Displays usage information
aa46a8
 .IP "\fB--help\fR"
aa46a8
--- logwatch-20110113/scripts/logwatch.pl.orig	2011-01-13 11:40:57.083697486 +0100
aa46a8
+++ logwatch-20110113/scripts/logwatch.pl	2011-01-13 11:48:07.477874059 +0100
aa46a8
@@ -187,6 +187,7 @@ my @TempLogFileList = ();
aa46a8
 my @TempServiceList = ();
aa46a8
 my $Help = 0;
aa46a8
 my $ShowVersion = 0;
aa46a8
+my $NoOldfilesLog = 0;
aa46a8
 my ($tmp_mailto, $tmp_savefile);
aa46a8
 
aa46a8
 &GetOptions ("d|detail=s"   => \$Config{'detail'},
aa46a8
@@ -209,6 +210,7 @@ my ($tmp_mailto, $tmp_savefile);
aa46a8
              "hostformat=s" => \$Config{'hostformat'},
aa46a8
              "hostlimit=s"  => \$Config{'hostlimit'},
aa46a8
              "html_wrap=s"  => \$Config{'html_wrap'},
aa46a8
+             "no-oldfiles-log" => \$NoOldfilesLog,
aa46a8
              "subject=s"    => \$Config{'subject'}
aa46a8
            ) or &Usage();
aa46a8
 
aa46a8
@@ -632,7 +634,7 @@ if ($Config{'debug'} > 7) {
aa46a8
 opendir(TMPDIR, $Config{'tmpdir'}) or die "$Config{'tmpdir'} $!";
aa46a8
 my @old_dirs = grep { /^logwatch\.\w{8}$/ && -d "$Config{'tmpdir'}/$_" }
aa46a8
    readdir(TMPDIR);
aa46a8
-if (@old_dirs) {
aa46a8
+if ((@old_dirs) && ($NoOldfilesLog==0)) {
aa46a8
    print "You have old files in your logwatch tmpdir ($Config{'tmpdir'}):\n\t";
aa46a8
    print join("\n\t", @old_dirs);
aa46a8
    print "\nThe directories listed above were most likely created by a\n";
aa46a8
@@ -1077,7 +1079,7 @@ sub ReadConfigFile {
aa46a8
 sub Usage () {
aa46a8
    # Show usage for this program
aa46a8
    print "\nUsage: $0 [--detail <level>] [--logfile <name>] [--output <output_type>]\n" .
aa46a8
-      "   [--format <format_type>] [--encode <enconding>] [--numeric]\n" .
aa46a8
+      "   [--format <format_type>] [--encode <enconding>] [--numeric] [--no-oldfiles-log]\n" .
aa46a8
       "   [--mailto <addr>] [--archives] [--range <range>] [--debug <level>]\n" .
aa46a8
       "   [--filename <filename>] [--help|--usage] [--version] [--service <name>]\n" .
aa46a8
       "   [--hostformat <host_format type>] [--hostlimit <host1,host2>] [--html_wrap <num_characters>]\n\n";
aa46a8
@@ -1088,6 +1090,8 @@ sub Usage () {
aa46a8
    print "--output <output type>: Report Output - stdout [default], mail, file.\n"; #8.0
aa46a8
    print "--format <formatting>: Report Format - text [default], html.\n"; #8.0
aa46a8
    print "--encode <encoding>: Enconding to use - none [default], base64.\n"; #8.0
aa46a8
+   print "--no-oldfiles-log: Suppress the logwatch log, which informs about the\n"; 
aa46a8
+   print "                   old files in logwatch tmpdir.\n"; 
aa46a8
    print "--mailto <addr>: Mail report to <addr>.\n";
aa46a8
    print "--archives: Use archived log files too.\n";
aa46a8
    print "--filename <filename>: Used to specify they filename to save to. --filename <filename> [Forces output to file].\n";