From: Dirk Koopman Date: Tue, 17 Jul 2007 21:53:22 +0000 (+0100) Subject: Remove dupefile before restarting node. X-Git-Tag: 1.55~96 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=a6c17071301a48e8d82732fa2dbef3a1bc3691af Remove dupefile before restarting node. Also provide the clear/dupefile command to do it at runtime. --- diff --git a/Changes b/Changes index f03ffc3e..64a1dc1d 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +17Jul07======================================================================= +1. remove dupefile on startup and on ending the node. Add clear/dupefile +command to allow people to do it at runtime as well. 12Jul07======================================================================= 1. Change disconnection code so that nodes that are no longer routable are (all) cleared out. diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index 74520ea3..30c6aea5 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -328,6 +328,21 @@ see CLEAR/SPOTS for a more detailed explanation. A sysop can clear an input or normal output filter for a user or the node_default or user_default. +=== 6^CLEAR/DUPEFILE^Clear out the dupefile completely +The system maintains a list of duplicate announces and spots (amongst many +other things). Sometimes this file gets corrupted during operation +(although not very often). This command will remove the file and start +again from scratch. + +Try this if you get several duplicate DX Spots, one after another. + +Please ONLY use this command if you have a problem. And then only once. +If it does not cure your problem, then repeating the command won't help. +Get onto the dxspider-support list and let us try to help. + +If you use this command frequently then you will cause other people, as +well as yourself, a lot of problems with duplicates. + === 0^CLEAR/ROUTE [1|all]^Clear a route filter line This command allows you to clear (remove) a line in a route filter or to remove the whole filter. diff --git a/cmd/clear/dupefile.pl b/cmd/clear/dupefile.pl new file mode 100644 index 00000000..909f7f9e --- /dev/null +++ b/cmd/clear/dupefile.pl @@ -0,0 +1,19 @@ +# +# clear out and replace dupefile with an empty one +# +# Copyright (c) 2007 Dirk Koopman, G1TLH +# +# + +my ($self, $line) = @_; + +# are we permitted (we could allow fairly privileged people to do this)? +return (1, $self->msg('e5')) if $self->priv < 6; + +DXDupe::finish(); +DXDupe::init(); + +return (1, $self->msg('done')); + + + diff --git a/perl/DXDupe.pm b/perl/DXDupe.pm index 851e3a69..5b288d1f 100644 --- a/perl/DXDupe.pm +++ b/perl/DXDupe.pm @@ -21,14 +21,9 @@ $fn = "$main::data/dupefile"; sub init { + unlink $fn; $dbm = tie (%d, 'DB_File', $fn); - unless ($dbm) { - eval { untie %d }; - dbg("Dupefile $fn corrupted, removing..."); - unlink $fn; - $dbm = tie (%d, 'DB_File', $fn) or confess "can't open dupe file: $fn ($!)"; - confess "cannot open $fn $!" unless $dbm; - } + confess "cannot open $fn $!" unless $dbm; } sub finish @@ -36,6 +31,7 @@ sub finish undef $dbm; untie %d; undef %d; + unlink $fn; } sub check diff --git a/perl/Version.pm b/perl/Version.pm index 479b37a2..db94a844 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '118'; +$build = '119'; 1;