projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Try to fix auto-locking (only for nodes)
[spider.git]
/
perl
/
DXLogPrint.pm
diff --git
a/perl/DXLogPrint.pm
b/perl/DXLogPrint.pm
index 0d99eb41804a740a9d0e95a18c13cabdf2a93b36..32f39c26904d2560652ed1870651688834f3a55c 100644
(file)
--- a/
perl/DXLogPrint.pm
+++ b/
perl/DXLogPrint.pm
@@
-36,11
+36,11
@@
$maxmonths = 36;
#
# This command outputs a list of n lines starting from time t with $pattern tags
#
#
# This command outputs a list of n lines starting from time t with $pattern tags
#
-sub
print
+sub
search
{
my $fcb = $DXLog::log;
{
my $fcb = $DXLog::log;
- my $from = shift
||
0;
- my $to = shift
||
10;
+ my $from = shift
//
0;
+ my $to = shift
//
10;
my $jdate = $fcb->unixtoj(shift);
my $pattern = shift;
my $who = shift;
my $jdate = $fcb->unixtoj(shift);
my $pattern = shift;
my $who = shift;
@@
-53,17
+53,19
@@
sub print
$who = uc $who if defined $who;
$who = uc $who if defined $who;
+ dbg("from: $from to: $to pattern: $pattern hint: $hint") if isdbg('search');
+
if ($pattern) {
if ($pattern) {
- $hint = q{m{\Q$pattern\E}i};
+ $hint = q
q
{m{\Q$pattern\E}i};
} else {
$hint = q{!m{\^(?:ann|rcmd|talk|chat)\^}};
}
if ($who) {
$hint .= ' && ' if $hint;
} else {
$hint = q{!m{\^(?:ann|rcmd|talk|chat)\^}};
}
if ($who) {
$hint .= ' && ' if $hint;
- $hint .= q{m{\Q$who\E}
o
i};
+ $hint .= q{m{\Q$who\E}i};
}
$hint = "next unless $hint" if $hint;
}
$hint = "next unless $hint" if $hint;
- $hint .= "; next unless m{^\\d+\\^$pattern\\^}" if $pattern;
+ $hint .= "; next unless m{^\\d+\\^$pattern\\^}
i
" if $pattern;
$hint ||= "";
$eval = qq(while (<\$fh>) {
$hint ||= "";
$eval = qq(while (<\$fh>) {
@@
-113,9
+115,19
@@
sub print
}
for (sort {$a <=> $b } @in) {
}
for (sort {$a <=> $b } @in) {
- my @line = split /\^/ ;
- push @out, print_item(\@line);
-
+ push @out, [ split /\^/ ]
+ }
+
+ return @out;
+}
+
+sub print
+{
+ my @out;
+
+ my @in = search(@_);
+ for (@in) {
+ push @out, print_item($_);
}
return @out;
}
}
return @out;
}