projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3798e9
)
fix DXUtil::localdata ?perl bug?
author
Dirk Koopman
<djk@tobit.co.uk>
Sun, 26 Apr 2020 13:02:48 +0000
(14:02 +0100)
committer
Dirk Koopman
<djk@tobit.co.uk>
Sun, 26 Apr 2020 13:02:48 +0000
(14:02 +0100)
perl/DXUtil.pm
patch
|
blob
|
history
perl/Prefix.pm
patch
|
blob
|
history
diff --git
a/perl/DXUtil.pm
b/perl/DXUtil.pm
index b669b3b3f8c78715b891e146f12e172d266f803e..8bb9b956c59d306b8aab36b6cab0807bca10c5bd 100644
(file)
--- a/
perl/DXUtil.pm
+++ b/
perl/DXUtil.pm
@@
-477,10
+477,10
@@
sub localdata
if (-e "$main::local_data") {
$tfn = "$main::data/$ifn";
if (-e "$main::local_data") {
$tfn = "$main::data/$ifn";
- if (
-e $tfn && -e $ofn
) {
+ if (
(-e $tfn) && (-e $ofn)
) {
$ofn = $tfn if -M $ofn < -M $tfn;
$ofn = $tfn if -M $ofn < -M $tfn;
- } els
if (-e tfn)
{
- $ofn = $tfn;
+ } els
e
{
+ $ofn = $tfn
if -e $tfn
;
}
}
}
}
diff --git
a/perl/Prefix.pm
b/perl/Prefix.pm
index fd361ebaaa178865211561087c26ae47eb7bf6d2..1e74d63dbc2f8a4f141d2ca646da4650cc2dc42d 100644
(file)
--- a/
perl/Prefix.pm
+++ b/
perl/Prefix.pm
@@
-73,6
+73,8
@@
sub load
eval {$db = tie(%pre, "DB_File", undef, O_RDWR|O_CREAT, 0664, $DB_BTREE);};
my $out = "$@($!)" if !$db || $@ ;
my $fn = localdata("prefix_data.pl");
eval {$db = tie(%pre, "DB_File", undef, O_RDWR|O_CREAT, 0664, $DB_BTREE);};
my $out = "$@($!)" if !$db || $@ ;
my $fn = localdata("prefix_data.pl");
+ die "Prefix.pm: cannot find $fn, have you run /spider/perl/create_prefix.pl?" unless -e $fn;
+
eval {do $fn if !$out; };
$out .= $@ if $@;
$lru = LRU->newbase('Prefix', $lrusize);
eval {do $fn if !$out; };
$out .= $@ if $@;
$lru = LRU->newbase('Prefix', $lrusize);