1. added grepdbg program (so you can search your debug files and get times
authordjk <djk>
Tue, 15 Jun 1999 09:19:17 +0000 (09:19 +0000)
committerdjk <djk>
Tue, 15 Jun 1999 09:19:17 +0000 (09:19 +0000)
and dates of incidents).
2. Moved DXVars.pm to DXVars.pm.issue to force new users to cp it to their
local directory.
3. added $allowzero to DXProt to allow thru PC19s with zero protocol versions.

Changes
perl/DXLog.pm
perl/DXProt.pm
perl/DXVars.pm [deleted file]
perl/DXVars.pm.issue [new file with mode: 0644]
perl/Julian.pm
perl/Spot.pm
perl/grepdbg [new file with mode: 0755]

diff --git a/Changes b/Changes
index 67be5403c49fefa33e9543b7c2b9835654cb3910..17d937a782e21f1eee33e9e0556198f8a2a53141 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,9 @@
+15Jun99=======================================================================
+1. added grepdbg program (so you can search your debug files and get times
+and dates of incidents).
+2. Moved DXVars.pm to DXVars.pm.issue to force new users to cp it to their
+local directory.
+3. added $allowzero to DXProt to allow thru PC19s with zero protocol versions.
 14Jun99=======================================================================
 1. changed IO::File in help and apropos to IO::File
 2. added a check for isa('DXNode') for PC50s
index 8281e154e86f6998ecbc25d48d5652de9be76c28..17559b36fe62577d2b53cef0c8f9f810d225c5ba 100644 (file)
@@ -31,7 +31,7 @@ require Exporter;
 
 use IO::File;
 use DXVars;
-use DXDebug ();
+use DXDebug ();
 use DXUtil;
 use Julian;
 use Carp;
@@ -53,7 +53,7 @@ sub new
        $ref->{'sort'} = $sort;
                
        # make sure the directory exists
-       mkdir($ref->{prefix}, 0777) if ! -e $ref->{prefix};
+       mkdir($ref->{prefix}, 0777) unless -e $ref->{prefix};
        return bless $ref;
 }
 
@@ -83,7 +83,7 @@ sub open
        $self->{year} = $year;
        $self->{thing} = $thing;
        
-       DXDebug::dbg("dxlog", "opening $self->{fn}\n");
+#      DXDebug::dbg("dxlog", "opening $self->{fn}\n");
        
        return $self->{fh};
 }
index 17328bc2cc6ee79c9e31d76cd31cd8df929d393d..16b67023a7f09d579ff8bfd01ac2246f3188f74a 100644 (file)
@@ -31,7 +31,7 @@ use strict;
 use vars qw($me $pc11_max_age $pc11_dup_age $pc23_dup_age 
                        %spotdup %wwvdup $last_hour %pings %rcmds 
                        %nodehops @baddx $baddxfn $pc12_dup_age
-                       %anndup);
+                       %anndup $allowzero);
 
 $me = undef;                                   # the channel id for this cluster
 $pc11_max_age = 1*3600;                        # the maximum age for an incoming 'real-time' pc11
@@ -385,6 +385,8 @@ sub normal
                                my $call = uc $field[$i+1];
                                my $confmode = $field[$i+2];
                                my $ver = $field[$i+3];
+
+                               $ver = 5400 if !$ver && $allowzero;
                                
                                # now check the call over
                                my $node = DXCluster->get_exact($call);
diff --git a/perl/DXVars.pm b/perl/DXVars.pm
deleted file mode 100644 (file)
index ab43ca6..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# The system variables - those indicated will need to be changed to suit your
-# circumstances (and callsign)
-#
-# Copyright (c) 1998 - Dirk Koopman G1TLH
-#
-# $Id$
-#
-
-package main;
-
-require Exporter;
-@ISA = qw(Exporter);
-
-@EXPORT_OK = qw($mycall $myname $myalias $mylatitude $mylongtitude $mylocator
-                $myqth $myemail $myprot_version 
-                $clusterport $clusteraddr $debugfn 
-                $def_hopcount $data $system $cmd
-                               $userfn $motd $local_cmd $mybbsaddr
-                $lang
-                               $pc50_interval $user_interval
-               );
-                          
-                          
-# this really does need to change for your system!!!!                     
-$mycall = "GB7DJK";
-
-# your name
-$myname = "Dirk";
-
-# Your 'normal' callsign 
-$myalias = "G1TLH";
-
-# Your latitude (+)ve = North (-)ve = South in degrees and decimal degrees
-$mylatitude = +52.68584579;
-
-# Your Longtitude (+)ve = East, (-)ve = West in degrees and decimal degrees
-$mylongitude = +0.94518260;
-
-# Your locator (yes I know I can calculate it - eventually)
-$mylocator = "JO02LQ";
-
-# Your QTH (roughly)
-$myqth = "East Dereham, Norfolk";
-
-# Your e-mail address
-$myemail = "djk\@tobit.co.uk";
-
-# Your BBS addr
-$mybbsaddr = "G1TLH\@GB7TLH.#35.GBR.EU";
-
-# the default language (the key used must match the one in the Messages file)
-$lang = 'en';
-
-# the tcp address of the cluster this can be an address of an ethernet port
-# but this is more secure. For normal use this will be fine. 
-$clusteraddr = "localhost";
-
-# the port number of the cluster (just leave this, unless it REALLY matters to you)
-$clusterport = 27754;
-
-# your favorite way to say 'Yes'
-$yes = 'Yes';
-
-# your favorite way to say 'No'
-$no = 'No';
-
-# the interval between unsolicited prompts if not traffic
-$user_interval = 11*60;
-
-# data files live in 
-$data = "$root/data";
-
-# system files live in
-$system = "$root/sys";
-
-# command files live in
-$cmd = "$root/cmd";
-
-# local command files live in (and overide $cmd)
-$localcmd = "$root/local_cmd";
-
-# where the user data lives
-$userfn = "$data/users";
-
-# the "message of the day" file
-$motd = "$data/motd";
-
-# are we debugging ?
-@debug = ('chan', 'state', 'msg', 'cron');
diff --git a/perl/DXVars.pm.issue b/perl/DXVars.pm.issue
new file mode 100644 (file)
index 0000000..ab43ca6
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# The system variables - those indicated will need to be changed to suit your
+# circumstances (and callsign)
+#
+# Copyright (c) 1998 - Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+package main;
+
+require Exporter;
+@ISA = qw(Exporter);
+
+@EXPORT_OK = qw($mycall $myname $myalias $mylatitude $mylongtitude $mylocator
+                $myqth $myemail $myprot_version 
+                $clusterport $clusteraddr $debugfn 
+                $def_hopcount $data $system $cmd
+                               $userfn $motd $local_cmd $mybbsaddr
+                $lang
+                               $pc50_interval $user_interval
+               );
+                          
+                          
+# this really does need to change for your system!!!!                     
+$mycall = "GB7DJK";
+
+# your name
+$myname = "Dirk";
+
+# Your 'normal' callsign 
+$myalias = "G1TLH";
+
+# Your latitude (+)ve = North (-)ve = South in degrees and decimal degrees
+$mylatitude = +52.68584579;
+
+# Your Longtitude (+)ve = East, (-)ve = West in degrees and decimal degrees
+$mylongitude = +0.94518260;
+
+# Your locator (yes I know I can calculate it - eventually)
+$mylocator = "JO02LQ";
+
+# Your QTH (roughly)
+$myqth = "East Dereham, Norfolk";
+
+# Your e-mail address
+$myemail = "djk\@tobit.co.uk";
+
+# Your BBS addr
+$mybbsaddr = "G1TLH\@GB7TLH.#35.GBR.EU";
+
+# the default language (the key used must match the one in the Messages file)
+$lang = 'en';
+
+# the tcp address of the cluster this can be an address of an ethernet port
+# but this is more secure. For normal use this will be fine. 
+$clusteraddr = "localhost";
+
+# the port number of the cluster (just leave this, unless it REALLY matters to you)
+$clusterport = 27754;
+
+# your favorite way to say 'Yes'
+$yes = 'Yes';
+
+# your favorite way to say 'No'
+$no = 'No';
+
+# the interval between unsolicited prompts if not traffic
+$user_interval = 11*60;
+
+# data files live in 
+$data = "$root/data";
+
+# system files live in
+$system = "$root/sys";
+
+# command files live in
+$cmd = "$root/cmd";
+
+# local command files live in (and overide $cmd)
+$localcmd = "$root/local_cmd";
+
+# where the user data lives
+$userfn = "$data/users";
+
+# the "message of the day" file
+$motd = "$data/motd";
+
+# are we debugging ?
+@debug = ('chan', 'state', 'msg', 'cron');
index 1316fb42329202f86d240ea11315f297b8d80e1a..8b3b74fdb8dd235b5c3dbb24e5376fe65106952c 100644 (file)
@@ -8,7 +8,6 @@
 
 package Julian;
 
-use DXDebug;
 use Carp;
 
 use strict;
index 7302193a9c3bfb462bfbbc9f4ff23871dd46b2b9..cdd7393d21803c8f85931cf525e79664bec6eb89 100644 (file)
@@ -105,7 +105,7 @@ sub search
        my $ref;
        my $i;
        my $count;
-       my @today = Julian::unixtoj(time);
+       my @today = Julian::unixtoj(time());
        my @fromdate;
        my @todate;
 
diff --git a/perl/grepdbg b/perl/grepdbg
new file mode 100755 (executable)
index 0000000..c44fc92
--- /dev/null
@@ -0,0 +1,66 @@
+#!/usr/bin/perl
+#
+# Program to do a grep with dates and times on the debug
+# files
+#
+# dispdbg [-nnn ...] <string>
+#
+# the -nnn is the day you what to look at -1 is yesterday -0 is today
+# and is optional if there is only one argument
+# <string> is the string, a caseless search is done
+#
+#
+
+require 5.004;
+
+# search local then perl directories
+BEGIN {
+       # root of directory tree for this system
+       $root = "/spider"; 
+       $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
+       
+       unshift @INC, "$root/perl";     # this IS the right way round!
+       unshift @INC, "$root/local";
+}
+
+use DXVars;
+use DXUtil;
+use DXLog;
+
+use strict;
+
+use vars qw(@list $fp @today $string);
+
+$fp = DXLog::new('debug', 'dat', 'd');
+@today = Julian::unixtoj(time()); 
+
+for my $arg (@ARGV) {
+       if ($arg =~ /^-/) {
+               $arg =~ s/^-//o;
+               push @list, $arg;
+       } else {
+               $string = $arg;
+               last;
+       }
+}
+die "usage: dispdbg [[-nnn] ..] <string>\n" unless  $string;
+
+push @list, "0" unless @list;
+for my $entry (@list) {
+       my @now = Julian::sub(@today, $entry); 
+       my $fh = $fp->open(@now); 
+       my $line;
+       if ($fh) {
+               while (<$fh>) {
+                       my $line = $_;
+                       chomp $line;
+                       if ($line =~ m{\Q$string}io) {
+                               my @line =  split '\^', $line;
+                               my $t = shift @line;
+                               print atime($t), ' ', join('^', @line), "\n"; 
+                       }
+               }
+               $fp->close();
+       }
+}
+exit(0);