X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=cmd%2Fshow%2Fnode.pl;h=c18d8fb9376dc8d71e18c48ac68243dfd5dcd8a0;hb=91cb091ed723c5650202345ae9c4f0277e36f0a8;hp=37db1dc8d1e21f77a4773af97f575c1fbd58a484;hpb=d11ddefb5de3e16b44f78fd9db541bccc9587082;p=spider.git diff --git a/cmd/show/node.pl b/cmd/show/node.pl index 37db1dc8..c18d8fb9 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -22,7 +22,17 @@ my @out; # search thru the user for nodes unless (@call) { - @call = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->sort ne 'U') ? $_ : () } DXUser::get_all_calls; +# the official way +# @call = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->sort ne 'U') ? $_ : () } DXUser::get_all_calls; + use DB_File; + + my ($action, $count, $key, $data); + for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) { + if ($data =~ m{sort => '[ACRSX]'}) { + push @call, $key; + } + ++$count; + } } my $call; @@ -34,6 +44,7 @@ foreach $call (@call) { my $pcall = sprintf "%-11s", $call; push @out, $self->msg('snode1') unless @out > 0; if ($uref) { + $sort = "Unknwn"; $sort = "Spider" if $uref->is_spider; $sort = "AK1A " if $uref->is_ak1a; $sort = "Clx " if $uref->is_clx; @@ -53,7 +64,7 @@ foreach $call (@call) { } my ($major, $minor, $subs) = unpack("AAA*", $ver) if $ver; - if ($sort eq 'Spider') { + if ($uref->is_spider) { push @out, $self->msg('snode2', $pcall, $sort, "$ver "); } else { push @out, $self->msg('snode2', $pcall, $sort, $ver ? "$major\-$minor.$subs" : " ");