Fix initial set of bugs pointed on mailing list
authorDirk Koopman <djk@tobit.co.uk>
Fri, 22 Jun 2007 17:50:11 +0000 (18:50 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 22 Jun 2007 17:50:11 +0000 (18:50 +0100)
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

Changes
cmd/Aliases
cmd/show/configuration.pl
cmd/show/newconfiguration.pl
perl/DXCommandmode.pm
perl/Route.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 0c3956de6ff9307ba16ee8db3a862a7bc7f62233..1a6121efe62306d572e903f200e128b71e9590e8 100644 (file)
--- 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=======================================================================
index 0a02b6ca9a5c613a3ea1fad59e6e5cc0c4f55538..1ea0c7873aea6e93b815e924ab8051037c5f5129 100644 (file)
@@ -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',
index 7c3281eadb8f193818ec555ee678d580ff69c163..09521cb6b7406e3d062994c90158243df744b857 100644 (file)
@@ -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 ||= '???';
index 6675619131b4eba8aef767c0d5b253110a533538..668a0b70c6e90f61fdec3eb620b9b8e8ae05981c 100644 (file)
@@ -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);
 
index 94c836344e54df81cdf098f4e3719a9940c0ee75..3eb9a1c6ce7ff153bebb30db4affbc9cf59dc227 100644 (file)
@@ -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 || '';
index cf4eb198e9d664746fb8920717571ceffee79f27..afce3a042d850200af3b9478d8e6b88cd8527403 100644 (file)
@@ -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|$_|, @_);
                }
index dc12092ad91b95affb1f198e64140f534e121d50..ad2cecdae143c2cda6c83318ac004f504f3fb118 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '59';
+$build = '60';
 
 1;