X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fcluster.pl;h=e7f386977baad7a5137884f74e5d2adb13655274;hb=0f7fefc971df8d5bbaf852867aa5d965d98582b6;hp=572be7a9d6cdae83abe7a0ced707773ff692096d;hpb=6624dcdf07d628e8d6a16fc6549edf40be25b7b2;p=spider.git diff --git a/perl/cluster.pl b/perl/cluster.pl index 572be7a9..e7f38697 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -97,7 +97,7 @@ 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 $build $is_win $routeroot + $clusterport $mycall $decease $is_win $routeroot ); @inqueue = (); # the main input queue, an array of hashes @@ -107,6 +107,13 @@ $starttime = 0; # the starting time of the cluster #@outstanding_connects = (); # list of outstanding connects @listeners = (); # list of listeners +use vars qw($VERSION $BRANCH $build $branch); +$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0; +$main::build += 15; # add an offset to make it bigger than last system +$main::build += $VERSION; +$main::branch += $BRANCH; + # send a message to call on conn and disconnect sub already_conn @@ -324,29 +331,8 @@ foreach (@debug) { STDOUT->autoflush(1); # calculate build number -$build = $main::version; - -my @fn; -open(CL, "$main::root/perl/cluster.pl") or die "Cannot open cluster.pl $!"; -while () { - next unless /^use\s+([\w:_]+)/; - push @fn, $1; -} -close CL; -my $subbuild; -foreach my $fn (@fn) { - $fn =~ s|::|/|g; - open(CL, "$main::root/perl/${fn}.pm") or next; - while () { - if (/^#\s+\$Id:\s+[\w\._]+,v\s+(\d+\.\d+)\.?(\d+.\d+)?/ ) { - $build += $1; - $subbuild += $2 if $2; - last; - } - } - close CL; -} -$build = "$build.$subbuild" if $subbuild; +$build += $main::version; +$build = "$build.$branch" if $branch; Log('cluster', "DXSpider V$version, build $build started"); @@ -455,6 +441,9 @@ eval { }; dbg("Local::init error $@") if $@; +dbg("cleaning out old debug files"); +DXDebug::dbgclean(); + # print various flags #dbg("seful info - \$^D: $^D \$^W: $^W \$^S: $^S \$^P: $^P");