summaryrefslogtreecommitdiff
path: root/www/checkbot/patches/patch-aa
blob: 516c98546f01b9ac6de01f2a3515a79885f3b305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$NetBSD: patch-aa,v 1.1 2000/12/28 13:33:11 abs Exp $

--- checkbot.pl.orig	Sun Sep 24 14:51:46 2000
+++ checkbot.pl
@@ -51,7 +51,7 @@
          [B<--mailto> email address]
          [B<--note> note] [B<--sleep> seconds] [B<--timeout> timeout]
          [B<--interval> seconds] [B<--dontwarn> HTTP responde codes]
-         [B<--enable-virtual>]
+         [B<--enable-virtual>] [B<--no-bak>]
          [start URLs]
 
 =head1 DESCRIPTION
@@ -180,6 +180,10 @@
 causes problems, which this feature work around by using the hostname
 to distinguish the server.
 
+=item --no-bak
+
+Do not save previous summary pages with .bak extensions.
+
 =back
 
 =head1 PREREQUISITES
@@ -255,7 +259,7 @@
 
   # Get command-line arguments
   use Getopt::Long;
-  my $result = GetOptions(qw(debug help verbose url=s match=s exclude|x=s file=s style=s ignore|z=s mailto|M=s note|N=s proxy=s internal-only sleep=i timeout=i interval=i dontwarn=s enable-virtual));
+  my $result = GetOptions(qw(debug help verbose url=s match=s exclude|x=s file=s style=s ignore|z=s mailto|M=s note|N=s proxy=s internal-only sleep=i timeout=i interval=i dontwarn=s enable-virtual no-bak));
 
   # Handle arguments, some are mandatory, some have defaults
   &print_help if (($main::opt_help && $main::opt_help) 
@@ -266,6 +270,7 @@
   $main::opt_interval = 10800 unless defined $main::opt_interval and length $main::opt_interval;
   $main::opt_dontwarn = "xxx" unless defined $main::opt_dontwarn and length $main::opt_dontwarn;
   $main::opt_enable_virtual = 0 unless defined $main::opt_enable_virtual;
+  $main::opt_no_bak = 0 unless defined $main::opt_no_bak;
   # The default for opt_match will be set later, because we might want
   # to muck with opt_url first.
 
@@ -698,7 +703,7 @@
     print STDERR "*** Start writing results page\n" if $main::opt_verbose;
 
     open(OUT, ">$main::file.new") 
-	|| die "$0: Unable to open $main::file.bak for writing:\n";
+	|| die "$0: Unable to open $main::file.new for writing:\n";
     print OUT "<head>\n";
     if (!$final_page) {
       printf OUT "<META HTTP-EQUIV=\"Refresh\" CONTENT = %d>\n",
@@ -762,6 +767,7 @@
     print OUT "<tr><th align=left>--ignore</th><td>Ignore regular expression</td><td>$main::opt_ignore</td></tr>\n" if defined $main::opt_ignore;
     print OUT "<tr><th align=left>--dontwarn</th><td>Don't warn for these codes</td><td>$main::opt_dontwarn</td></tr>\n" if $main::opt_dontwarn ne 'xxx';
     print OUT "<tr><th align=left>--enable-virtual</th><td>Use virtual names only</td><td>yes</td></tr>\n" if $main::opt_enable_virtual;
+    print OUT "<tr><th align=left>--no-bak</th><td>Do not save previous summaries in .bak files</td><td>yes</td></tr>\n" if $main::opt_no_bak;
     print OUT "<tr><th align=left>--internal-only</th><td>Check only internal links</td><td>yes</td></tr>\n" if defined $main::opt_internal_only;
     
     print OUT "</table>\n";
@@ -772,7 +778,9 @@
 
     close(OUT);
 
-    rename($main::file, $main::file . ".bak");
+    unless ($main::opt_no_bak) {
+	rename($main::file, $main::file . ".bak");
+    }
     rename($main::file . ".new", $main::file);
 
     print STDERR "*** Done writing result page\n" if $main::opt_verbose;
@@ -1121,6 +1129,7 @@
   print "  --interval seconds Maximum time interval between updates (default 10800)\n";
   print "  --dontwarn codes   Do not write warnings for these HTTP response codes\n";
   print "  --enable-virtual   Use only virtual names, not IP numbers for servers\n";
+  print "  --no-bak           Do not save previous summaries in .bak files\n";
   print "\n";
   print "Options --match, --exclude, and --ignore can take a perl regular expression\nas their argument\n\n";
   print "Use 'perldoc checkbot' for more verbose documentation.\n\n";