Fix issues finding $main::data etc on clean install
authorDirk Koopman <djk@tobit.co.uk>
Mon, 9 Jan 2017 14:57:02 +0000 (14:57 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 9 Jan 2017 14:57:02 +0000 (14:57 +0000)
Changes
perl/SysVar.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index 5d16d91f64bc95ae9596d1b32136893456afdc61..13fa2e16b734fefd460299963369ab26175db6be 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+09Jan17=======================================================================
+1. Fix mojo branch clean install issues (failing to find $main::data et al)
 02Jan17=======================================================================
 1. Add CTY-2615 prefixes
 2. Add rbn.pl - an experimental rbn deduplicating spot filter. 
index 92a81e4b4d584422ebcb879190e54a1cd0d7617c..a45218781f4bfde4fba7675144bbbc6bf6d85141 100644 (file)
@@ -6,7 +6,8 @@
 #
 
 package main;
-use warnings;
+
+use vars qw($data $local_data $system $cmd $localcmd $userfn $motd);
 
 ##
 ## DXVars.pm overrides
@@ -26,12 +27,6 @@ $cmd = "$root/cmd";
 # local command files live in (and overide $cmd)
 $localcmd = "$root/local_cmd";
 
-# data files live in 
-$data = "$root/data";
-
-# for local data
-$local_data = "$root/local_data";
-
 # where the user data lives
 $userfn = "$local_data/users";
 
index 4222132c2b982bee9fe2490d99cab9ca184ab224..4aa81c62e939b52467dbbe1a4bb24de4b5a69c02 100755 (executable)
@@ -15,6 +15,8 @@ package main;
 require 5.10.1;
 use warnings;
 
+use vars qw($root $is_win $systime);
+
 # make sure that modules are searched in the order local then perl
 BEGIN {
        umask 002;
@@ -32,12 +34,15 @@ BEGIN {
        die "$root/local/DXVars.pm doesn't exist, please RTFM" unless -e "$root/local/DXVars.pm";
 
        # create some directories
-       mkdir "$root/local_cmd", 02777 unless -d "$root/local_cmd";
-       mkdir "$root/local_data", 02777 unless -d "$root/local_data";
+       mkdir "$root/local_cmd", 02774 unless -d "$root/local_cmd";
+
+       # locally stored data lives here
+       my $local_data = "$root/local_data";
+       mkdir $local_data, 02774 unless -d $local_data;
 
        # try to create and lock a lockfile (this isn't atomic but
        # should do for now
-       $lockfn = "$root/local_data/cluster.lck";       # lock file name
+       my $lockfn = "$root/local_data/cluster.lck";       # lock file name
        if (-w $lockfn) {
                open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
                my $pid = <CLLOCK>;
@@ -57,14 +62,16 @@ BEGIN {
 
        $is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows?
        $systime = time;
+       
 }
 
-                       
-use Mojo::IOLoop;
-
 use DXVars;
 use SysVar;
 
+use strict;
+                       
+use Mojo::IOLoop;
+
 use Msg;
 use IntMsg;
 use Internet;
@@ -127,12 +134,9 @@ use Web;
 
 use Local;
 
-package main;
-
-use strict;
-use vars qw(@inqueue $systime $starttime $lockfn @outstanding_connects
-                       $zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr
-                       $clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting
+use vars qw(@inqueue $starttime $lockfn @outstanding_connects
+                       $zombies @listeners $lang $myalias @debug $userfn $clusteraddr
+                       $clusterport $mycall $decease $routeroot $me $reqreg $bumpexisting
                        $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart
                        $can_encode $maxconnect_user $maxconnect_node $idle_interval $log_flush_interval
                        $broadcast_debug