From 9630876e30f288575b5343ec2d0b5bb6d67f92cc Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 16 Mar 2001 17:50:50 +0000 Subject: [PATCH] moved $build calculation to main routine to make it available everywhere altered PC18 to should version and build information --- Changes | 3 +++ cmd/show/version.pl | 19 +------------------ perl/DXProtout.pm | 3 +-- perl/cluster.pl | 35 +++++++++++++++++++++++++++++------ 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/Changes b/Changes index baae35ff..2ccd8b4e 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +16Mar01======================================================================= +1. integrate build number into main cluster and change the PC18 to show +version and build in the text portion 14Mar01======================================================================= 1. first cut at outgoing ax25 /external program connects 2. slight change of interface to connect diff --git a/cmd/show/version.pl b/cmd/show/version.pl index da72e305..fe0ae4d9 100644 --- a/cmd/show/version.pl +++ b/cmd/show/version.pl @@ -7,25 +7,8 @@ # my @out; -my $build = $main::version; -if (opendir(DIR, "$main::root/perl")) { - my @d = readdir(DIR); - closedir(DIR); - foreach my $fn (@d) { - if ($fn =~ /^cluster\.pl$/ || $fn =~ /\.pm$/) { - my $f = new IO::File "$main::root/perl/$fn" or next; - while (<$f>) { - if (/^#\s+\$Id:\s+[\w\._]+,v\s+(\d+\.\d+)/ ) { - $build += $1; - last; - } - } - $f->close; - } - } -} -push @out, "DX Spider Cluster version $main::version (build $build) on \u$^O"; +push @out, "DX Spider Cluster version $main::version (build $main::build) on \u$^O"; push @out, "Copyright (c) 1998-2001 Dirk Koopman G1TLH"; return (1, @out); diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index 47d44c92..86ab0e86 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -102,8 +102,7 @@ sub pc17 # Request init string sub pc18 { - my $info = DXCluster::cluster; - return "PC18^$info^$DXProt::myprot_version^"; + return "PC18^DXSpider Version $main::version Build $main::build^$DXProt::myprot_version^"; } # diff --git a/perl/cluster.pl b/perl/cluster.pl index 06dab32b..b3b4c5a6 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -67,6 +67,7 @@ use DXDupe; use BadWords; use Data::Dumper; +use IO::File; use Fcntl ':flock'; use POSIX ":sys_wait_h"; @@ -75,8 +76,10 @@ use Local; package main; use strict; -use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects $zombies $root - @listeners $lang $myalias @debug $userfn $clusteraddr $clusterport $mycall $decease ); +use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects + $zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr + $clusterport $mycall $decease $build + ); @inqueue = (); # the main input queue, an array of hashes $systime = 0; # the time now (in seconds) @@ -228,8 +231,8 @@ sub cease $_->close_server; } - dbg('chan', "DXSpider version $version ended"); - Log('cluster', "DXSpider V$version stopped"); + dbg('chan', "DXSpider version $version, build $build ended"); + Log('cluster', "DXSpider V$version, build $build ended"); dbgclose(); Logclose(); unlink $lockfn; @@ -309,10 +312,30 @@ foreach (@debug) { } STDOUT->autoflush(1); -Log('cluster', "DXSpider V$version started"); +# calculate build number +$build = $main::version; + +if (opendir(DIR, "$main::root/perl")) { + my @d = readdir(DIR); + closedir(DIR); + foreach my $fn (@d) { + if ($fn =~ /^cluster\.pl$/ || $fn =~ /\.pm$/) { + my $f = new IO::File "$main::root/perl/$fn" or next; + while (<$f>) { + if (/^#\s+\$Id:\s+[\w\._]+,v\s+(\d+\.\d+)/ ) { + $build += $1; + last; + } + } + $f->close; + } + } +} + +Log('cluster', "DXSpider V$version, build $build started"); # banner -dbg('err', "DXSpider DX Cluster Version $version", "Copyright (c) 1998-2001 Dirk Koopman G1TLH"); +dbg('err', "DXSpider Version $version, build $build started", "Copyright (c) 1998-2001 Dirk Koopman G1TLH"); # load Prefixes dbg('err', "loading prefixes ..."); -- 2.43.0