projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix SSID ambiguity on spotter in DX
[spider.git]
/
perl
/
DXDupe.pm
diff --git
a/perl/DXDupe.pm
b/perl/DXDupe.pm
index fb1210a2a15b7186c11980712b52ba6120d80a1d..1a0eb14c9de608afca15c330b73155c9704a7411 100644
(file)
--- a/
perl/DXDupe.pm
+++ b/
perl/DXDupe.pm
@@
-20,14
+20,12
@@
$lasttime = 0;
$fn = "$main::data/dupefile";
use vars qw($VERSION $BRANCH);
$fn = "$main::data/dupefile";
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
sub init
{
sub init
{
- $dbm = tie (%d, 'DB_File', $fn)
or confess "can't open dupe file: $fn ($!)"
;
+ $dbm = tie (%d, 'DB_File', $fn);
unless ($dbm) {
eval { untie %d };
dbg("Dupefile $fn corrupted, removing...");
unless ($dbm) {
eval { untie %d };
dbg("Dupefile $fn corrupted, removing...");
@@
-46,21
+44,21
@@
sub finish
sub check
{
sub check
{
- my
($s, $t) = @_
;
+ my
$s = shift
;
return 1 if find($s);
return 1 if find($s);
- add($s,
$
t);
+ add($s,
shif
t);
return 0;
}
sub find
{
return 0;
}
sub find
{
- return
1 if exists
$d{$_[0]};
+ return $d{$_[0]};
}
sub add
{
}
sub add
{
- my
($s, $t) = @_
;
-
$t = $main::systime + $default unless $
t;
+ my
$s = shift
;
+
my $t = shift || $main::systime + $defaul
t;
$d{$s} = $t;
}
$d{$s} = $t;
}