X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fdx.pl;h=4f71c13e51d69adf01d86e40b3c3e3af405b4fab;hb=ee55bc4f9cf0763f17c9698ab4c7d47a4e7008ce;hp=5387b7f407657ee5591711a0ae6a040abc5bf04b;hpb=2733a992ac8c3d315c110a2cc1984ea0a5e5d0ff;p=spider.git diff --git a/cmd/show/dx.pl b/cmd/show/dx.pl index 5387b7f4..4f71c13e 100644 --- a/cmd/show/dx.pl +++ b/cmd/show/dx.pl @@ -41,6 +41,8 @@ sub handle dbg("sh/dx list: " . join(" ", @list)) if isdbg('sh/dx'); + +# $DB::single=1; while (@list) { # next field $f = shift @list; @@ -143,11 +145,7 @@ sub handle } else { $pre .= '*' unless $pre =~ /[\*\?\[]$/o; $pre = shellregex($pre); - if ($usesql) { - $pre =~ s/\.\*/%/g; - } else { - $pre =~ s/\.\*\$$//; - } + $pre =~ s/\.\*\$$//; $pre .= '$' if $exact; $pre =~ s/\^//; push @flist, 'call', $pre; @@ -166,8 +164,8 @@ sub handle # now do the search - if ($self->{_nospawn}) { - my @res = Spot::search($expr, $fromday, $today, $from, $to, $user, $dofilter ? $self : undef); + if ($self->{_nospawn} || ($Spot::spotcachedays && !$expr && $from == 0 && $fromday == 0 && $today == 0)) { + my @res = Spot::search($expr, $fromday, $today, $from, $to, $user, $dofilter, $self); my $ref; my @dx; foreach $ref (@res) { @@ -179,14 +177,14 @@ sub handle push @out, DXCommandmode::format_dx_spot($self, @$ref); } else { - push @out, Spot::formatl(@$ref); + push @out, Spot::formatl($self->{width}, @$ref); } } } } else { push @out, $self->spawn_cmd("sh/dx $line", \&Spot::search, - args => [$expr, $fromday, $today, $from, $to, $filter, $dofilter ? $self : undef], + args => [$expr, $fromday, $today, $from, $to, $filter, $dofilter, $self], cb => sub { my ($dxchan, @res) = @_; my $ref; @@ -201,7 +199,7 @@ sub handle push @out, DXCommandmode::format_dx_spot($self, @$ref); } else { - push @out, Spot::formatl(@$ref); + push @out, Spot::formatl($self->{width}, @$ref); } } }