Blame SOURCES/logwatch-oldfiles.patch

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