Git and Version string changes
authorDirk Koopman <djk@tobit.co.uk>
Sun, 12 Dec 2021 21:29:10 +0000 (21:29 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sun, 12 Dec 2021 21:29:10 +0000 (21:29 +0000)
1. Removed dependency on perl Git package.
2. Force code to change directory to $DXSPIDER_ROOT || '/spider'. Also force
   git -C $root describe.
3. Change git commands AGAIN to work on old perls (which mojo won't work on,
   but it makes my life easier).
4. Change version strings to include the perl version in use.

Changes
cmd/show/version.pl
perl/DXProtHandle.pm
perl/Msg.pm
perl/Route/Node.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index a139b629418bb421964f7107467c1573c2aab8c6..f072ce6754552f55375a36dd73419fca7a2c0f69 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,6 +2,9 @@
 1. Removed dependency on perl Git package.
 2. Force code to change directory to $DXSPIDER_ROOT || '/spider'. Also force
    git -C $root describe.
+3. Change git commands AGAIN to work on old perls (which mojo won't work on,
+   but it makes my life easier).
+4. Change version strings to include the perl version in use. 
 10Dec21=======================================================================
 1. Fix the output of set/dxgrid, set/usstate and set/dxcq or set/dxitu to how
    it was always supposed to be since 2003.
index 0b0f0cfb66df9645b7675af023173a2810f48c22..5707504a190705138cbdfe91cd289e203cf7c172 100644 (file)
@@ -23,7 +23,7 @@ if ($self->priv > 5 && @in) {
 } else {
        my ($year) = (gmtime($main::systime))[5];
        $year += 1900;
-       push @out, "DX Spider Cluster version $main::version (build $main::build git: $main::gitbranch/$main::gitversion) on \u$^O";
+       push @out, "DXSpider v$main::version (build $main::build git: $main::gitbranch/$main::gitversion) using perl $^V on \u$^O";
        push @out, "Copyright (c) 1998-$year Dirk Koopman G1TLH";
 }
 
index c4344339f16131424117c3e1d36f6f6f9fbe5af4..6d3c09de809ddd68f3f745677402bf98ba4693fa 100644 (file)
@@ -719,6 +719,8 @@ sub handle_18
 sub check_add_node
 {
        my $call = shift;
+       my $type = shift;
+       
 
        # add this station to the user database, if required (don't remove SSID from nodes)
        my $user = DXUser::get_current($call);
@@ -728,7 +730,7 @@ sub check_add_node
                $user->lockout(1);
                $user->homenode($call);
                $user->node($call);
-               $user->sort('A');
+               $user->sort($type || 'A');
                $user->lastin($main::systime); # this make it last longer than just this invocation
                $user->put;                             # just to make sure it gets written away!!!
        }
@@ -1560,6 +1562,7 @@ sub _add_thingy
                                }
                        } else {
                                dbg("ROUTE: added user $call to $ncall") if isdbg('routelow');
+                               my $user = check_add_node($call, 'U');
                                @rout = $parent->add_user($call, Route::here($here), $ip);
                                $dxchan->tell_buddies('loginb', $call, $ncall) if $dxchan;
                                my $r = Route::User::get($call);
index 13833962d3d316d26f997e8861a431d143bda478..087c0f263ed27c2653876c66fe0966da8dbcb928 100644 (file)
@@ -291,7 +291,8 @@ sub disconnect
                        dbg("Buffer empty, just close $call") if $dbg;
                        _close_it($conn);
                }
-       } else {
+       }
+       else {
                dbg((ref $conn) . " socket missing on $conn->{call}") if $dbg;
                _close_it($conn);
        }
index 193fb8de3d29ae55c2a4cf21fa67e879319d690c..02c8b341b2310f1d03c005aa3da6253879be4ba8 100644 (file)
@@ -270,6 +270,7 @@ sub calc_config_changes
        return (\@dnodes, \@dusers, \@nnodes, \@nusers);
 }
 
+
 sub new
 {
        my $pkg = shift;
index c04f1dbdc4ec4848902b4525422a0ea4b33d52d0..919c59db4278b0fc586db283202dc14c5aa65c41 100755 (executable)
@@ -428,7 +428,7 @@ sub cease
                $l->close_server;
        }
 
-       LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) on $^O ended");
+       LogDbg('cluster', "DXSpider v$version build $build (git: $gitbranch/$gitversion) using perl $^V on $^O ended");
        dbg("bye bye everyone - bye bye");
        dbgclose();
        Logclose();
@@ -522,7 +522,7 @@ sub setup_start
                
                # determine the real Git build number and branch
                my $desc;
-               eval {$desc = `git -C $root describe --long`};
+               eval {$desc = `git --git-dir=$root/.git describe --long`};
                if (!$@ && $desc) {
                        my ($v, $s, $b, $g) = $desc =~ /^([\d\.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
                        $version = $v;
@@ -532,8 +532,8 @@ sub setup_start
                }
                if (!$@) {
                        my @branch;
-                       
-                       eval {@branch = `git -C $root branch`};
+
+                       eval {@branch = `git --git-dir=$root/.git branch`};
                        unless ($@) {
                                for (@branch) {
                                        my ($star, $b) = split /\s+/;
@@ -560,7 +560,7 @@ sub setup_start
        # banner
        my ($year) = (gmtime)[5];
        $year += 1900;
-       LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) on $^O started");
+       LogDbg('cluster', "DXSpider v$version build $build (git: $gitbranch/$gitversion) using perl $^V on $^O started");
        dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH");
 
        # load Prefixes