From: Dirk Koopman Date: Fri, 22 Jun 2007 17:50:11 +0000 (+0100) Subject: Fix initial set of bugs pointed on mailing list X-Git-Tag: 1.55~155 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=6230850db2f82835e5ef75da4f418615ba4261da Fix initial set of bugs pointed on mailing list 1. Fix Alias for sh/mydx (so it isn't the same as sh/myfdx). 2. Fix sh/c/n uninitialised variable message 3. Fix (and improve) sh/newc gb7 problem --- diff --git a/Changes b/Changes index 0c3956de..1a6121ef 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +22Jun06======================================================================= +1. Fix Alias for sh/mydx (so it isn't the same as sh/myfdx). +2. Fix sh/c/n uninitialised variable message +3. Fix (and improve) sh/newc gb7 problem 21Jun06======================================================================= 1. merge back SIMPLEROUTE branch to issue as official 1.54. 18Jun06======================================================================= diff --git a/cmd/Aliases b/cmd/Aliases index 0a02b6ca..1ea0c787 100644 --- a/cmd/Aliases +++ b/cmd/Aliases @@ -128,14 +128,14 @@ package CmdAlias; '^sho?w?/fdx/d(\d+)', 'show/dx real from $1', 'show/fdx', '^sho?w?/fdx', 'show/dx real', 'show/fdx', '^sho?w?/gre?y?l?i?n?e?', 'show/grayline', 'show/grayline', - '^sho?w?/myd?x?/(\d+)-(\d+)', 'show/dx filter $1-$2', 'show/mydx', - '^sho?w?/myd?x?/(\d+)', 'show/dx filter $1', 'show/mydx', - '^sho?w?/myd?x?/d(\d+)', 'show/dx filter from $1', 'show/mydx', - '^sho?w?/myd?x?', 'show/dx filter', 'show/mydx', '^sho?w?/myfd?x?/(\d+)-(\d+)', 'show/dx filter real $1-$2', 'show/mydx', '^sho?w?/myfd?x?/(\d+)', 'show/dx filter real $1', 'show/mydx', '^sho?w?/myfd?x?/d(\d+)', 'show/dx filter real from $1', 'show/mydx', '^sho?w?/myfd?x?', 'show/dx filter real', 'show/mydx', + '^sho?w?/myd?x?/(\d+)-(\d+)', 'show/dx filter $1-$2', 'show/mydx', + '^sho?w?/myd?x?/(\d+)', 'show/dx filter $1', 'show/mydx', + '^sho?w?/myd?x?/d(\d+)', 'show/dx filter from $1', 'show/mydx', + '^sho?w?/myd?x?', 'show/dx filter', 'show/mydx', '^sho?w?/newco?n?\w*/n', 'show/newconfiguration node', 'show/newconfiguration', '^sho?w?/sta?$', 'show/station', 'show/station', '^sho?w?/tnc', 'who', 'who', diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index 7c3281ea..09521cb6 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -20,7 +20,7 @@ if ($list[0] && $list[0] =~ /^NOD/) { my $dxchan; foreach $dxchan (@ch) { - @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes; + @val = sort {$a->call cmp $b->call} grep { $_->dxchan && $_->dxchan == $dxchan } @nodes; @l = (); my $call = $dxchan->call; $call ||= '???'; diff --git a/cmd/show/newconfiguration.pl b/cmd/show/newconfiguration.pl index 66756191..668a0b70 100644 --- a/cmd/show/newconfiguration.pl +++ b/cmd/show/newconfiguration.pl @@ -16,6 +16,6 @@ if (@list && $list[0] =~ /^NOD/) { shift @list; } -push @out, $main::routeroot->config($nodes_only, 0, [], @list); +push @out, $main::routeroot->config($nodes_only, 0, {}, @list); return (1, @out); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 94c83634..3eb9a1c6 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -920,9 +920,9 @@ sub format_dx_spot my $t = ztime($_[2]); my $loc = ''; my $clth = $self->{consort} eq 'local' ? 29 : 30; - my $comment = substr $_[3], 0, $clth; + my $comment = substr (($_[3] || ''), 0, $clth); $comment .= ' ' x ($clth - length($comment)); - if ($self->{user}->wantgrid) { + if ($self->{user}->wantgrid) { my $ref = DXUser->get_current($_[4]); if ($ref) { $loc = $ref->qra || ''; diff --git a/perl/Route.pm b/perl/Route.pm index cf4eb198..afce3a04 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -180,34 +180,36 @@ sub user_call sub config { my $self = shift; - my $nodes_only = shift; + my $nodes_only = shift || 0; my $level = shift; my $seen = shift; my @out; my $line; - my $call = $self->user_call; + my $call = $self->{call}; my $printit = 1; + dbg("config: $call nodes: $nodes_only level: $level calls: " . join(',', @_)) if isdbg('routec'); + # allow ranges if (@_) { $printit = grep $call =~ m|$_|, @_; } if ($printit) { - my $pcall = $call; - $pcall .= ":" . $self->obscount if $self->via_pc92; + my $pcall = $self->user_call; + $pcall .= ":" . $self->obscount if isdbg('obscount'); $line = ' ' x ($level*2) . "$pcall"; - $call = ' ' x length $pcall; + $pcall = ' ' x length $pcall; # recursion detector - if ((DXChannel::get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) { + if ((DXChannel::get($call) && $level > 1) || $seen->{$call}) { $line .= ' ...'; push @out, $line; return @out; } - push @$seen, $self->{call}; + $seen->{$call}++; # print users unless ($nodes_only) { @@ -226,7 +228,7 @@ sub config } else { $line =~ s/\s+$//; push @out, $line; - $line = ' ' x ($level*2) . "$call->$c "; + $line = ' ' x ($level*2) . "$pcall->$c "; } } } @@ -234,6 +236,12 @@ sub config $line =~ s/->$//g; $line =~ s/\s+$//; push @out, $line if length $line; + } else { + # recursion detector + if ((DXChannel::get($call) && $level > 1) || $seen->{$call}) { + return @out; + } + $seen->{$call}++; } # deal with more nodes @@ -242,8 +250,12 @@ sub config if ($nref) { my $c = $nref->user_call; -# dbg("recursing from $call -> $c") if isdbg('routec'); - push @out, $nref->config($nodes_only, $level+1, $seen, @_); + dbg("recursing from $call -> $c") if isdbg('routec'); + my @rout = $nref->config($nodes_only, $level+1, $seen, @_); + if (@rout && @_) { + push @out, ' ' x ($level*2) . $self->user_call unless grep /^\s+$call/, @out; + } + push @out, @rout; } else { push @out, ' ' x (($level+1)*2) . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_); } diff --git a/perl/Version.pm b/perl/Version.pm index dc12092a..ad2cecda 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '59'; +$build = '60'; 1;