[Bio] / FigCommon / bootstrap.pl Repository:
ViewVC logotype

Diff of /FigCommon/bootstrap.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10, Thu Apr 1 12:59:40 2004 UTC revision 1.36, Mon Mar 24 16:04:25 2008 UTC
# Line 1  Line 1 
1  #  #
2    # Copyright (c) 2003-2006 University of Chicago and Fellowship
3    # for Interpretations of Genomes. All Rights Reserved.
4    #
5    # This file is part of the SEED Toolkit.
6    #
7    # The SEED Toolkit is free software. You can redistribute
8    # it and/or modify it under the terms of the SEED Toolkit
9    # Public License.
10    #
11    # You should have received a copy of the SEED Toolkit Public License
12    # along with this program; if not write to the University of Chicago
13    # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14    # Genomes at veronika@thefig.info or download a copy from
15    # http://www.theseed.org/LICENSE.TXT.
16    #
17    
18    #
19  # FIG bootstrap script.  # FIG bootstrap script.
20  #  #
21  # Control is passed here from the toplevel configure (or dists/releases/install depending  # Control is passed here from the toplevel configure (or dists/releases/install depending
# Line 7  Line 24 
24  # The configure has set the following environment variables for our use:  # The configure has set the following environment variables for our use:
25  #  #
26  #  FIG_HOME             Root of the FIGdisk tree we're setting up  #  FIG_HOME             Root of the FIGdisk tree we're setting up
27    #  FIGCONFIG_ENV_TYPE   Type of configuration environment - "config_file"  for config file with host-type->directory
28    #                       mappings, or "dir" tranditional single-environment configuration.
29  #  FIGCONFIG_ENV        Name of the environment we're configuring for  #  FIGCONFIG_ENV        Name of the environment we're configuring for
30    #  FIGCONFIG_ENV_CONFIG Location of enviroment configuration file.
31  #  FIGCONFIG_ENV_DIR    Directory in which the binary install tree for $FIGCONFIG_ENV lives  #  FIGCONFIG_ENV_DIR    Directory in which the binary install tree for $FIGCONFIG_ENV lives
32  #  FIGCONFIG_RELEASE    Release number we're configuring  #  FIGCONFIG_RELEASE    Release number we're configuring
33  #  FIGCONFIG_RELEASE_DIR Directory in which that release lives  #  FIGCONFIG_RELEASE_DIR Directory in which that release lives
# Line 36  Line 56 
56    
57      print "Here in the perl bootstrap. inc is:\n" . join("\n", @INC), "\n";      print "Here in the perl bootstrap. inc is:\n" . join("\n", @INC), "\n";
58    
59      my $my_prefix, $prefix, $inc, @newInc;      my ($my_prefix, $prefix, $inc, @newInc);
60    
61      $my_prefix = $ENV{FIGCONFIG_ENV_DIR};      $my_prefix = $ENV{FIGCONFIG_ENV_DIR};
62      open(P, "<$my_prefix/PREFIX");      open(P, "<$my_prefix/PREFIX");
# Line 46  Line 66 
66    
67      # print "Prefix is $prefix myprefix=$my_prefix\n";      # print "Prefix is $prefix myprefix=$my_prefix\n";
68    
69      if ($prefix ne $my_prefix)      if ($prefix ne $my_prefix and $ENV{FIGCONFIG_ENV_CONFIG_TYPE} eq 'dir')
70      {      {
71          @newInc = ();          @newInc = ();
72          for $inc (@INC)          for $inc (@INC)
# Line 101  Line 121 
121  #  #
122    
123  our $fig_disk = $ENV{FIG_HOME};  our $fig_disk = $ENV{FIG_HOME};
124    our $env_config_type = $ENV{FIGCONFIG_ENV_CONFIG_TYPE};
125    our $env_config_file = $ENV{FIGCONFIG_ENV_CONFIG_FILE};
126  our $env_name = $ENV{FIGCONFIG_ENV};  our $env_name = $ENV{FIGCONFIG_ENV};
127  our $env_dir = "$ENV{FIGCONFIG_ENV_DIR}";  our $env_dir = "$ENV{FIGCONFIG_ENV_DIR}";
128  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";
# Line 122  Line 144 
144  #  #
145  our $start_servers = "$fig_disk/bin/start-servers";  our $start_servers = "$fig_disk/bin/start-servers";
146  our $stop_servers = "$fig_disk/bin/stop-servers";  our $stop_servers = "$fig_disk/bin/stop-servers";
147    our $run_perl = "$fig_disk/bin/run_perl";
148    our $run_python = "$fig_disk/bin/run_python";
149    
150  sub configure_std_fig_environment  sub configure_std_fig_environment
151  {  {
# Line 131  Line 155 
155    
156      my $fig = "$fig_disk/FIG";      my $fig = "$fig_disk/FIG";
157      my $data = "$fig/Data";      my $data = "$fig/Data";
158        my $sproutData = "$fig/SproutData";
159    
160      my $hostname = `hostname`;      my $hostname = `hostname`;
161      chomp $hostname;      chomp $hostname;
# Line 139  Line 164 
164      push(@$Config, ["blastmat", "$fig_disk/BLASTMAT", 1]);      push(@$Config, ["blastmat", "$fig_disk/BLASTMAT", 1]);
165      push(@$Config, ["fig", $fig, 1]);      push(@$Config, ["fig", $fig, 1]);
166      push(@$Config, ["bin", $fig_bin, 1]);      push(@$Config, ["bin", $fig_bin, 1]);
167        push(@$Config, ["env_config_type", $env_config_type, 1]);
168        if ($env_config_type eq 'config_file')
169        {
170            push(@$Config, ["env_config_file", $env_config_file, 1]);
171            push(@$Config, [{ perl => '&compute_env_values; ', python => '' }]);
172        }
173        else
174        {
175      push(@$Config, ["ext_bin", $env_bin, 1]);      push(@$Config, ["ext_bin", $env_bin, 1]);
176            push(@$Config, ["common_runtime", $env_dir, 1]);
177        }
178        push(@$Config, ["arch", $ENV{FIGCONFIG_ENV}, 1]);
179        push(@$Config, ["var", "$fig/var", 1]);
180      push(@$Config, ["data", $data, 1]);      push(@$Config, ["data", $data, 1]);
181      push(@$Config, ["global", "$data/Global", 1]);      push(@$Config, ["global", "$data/Global", 1]);
182      push(@$Config, ["organisms", "$data/Organisms", 1]);      push(@$Config, ["organisms", "$data/Organisms", 1]);
183      push(@$Config, ["RC", "$fig_disk/FIG/ResolutionCenter", 1]);      push(@$Config, ["RC", "$fig_disk/FIG/ResolutionCenter", 1]);
184      push(@$Config, ["NR", "$fig_disk/FIG/NR", 1]);      push(@$Config, ["NR", "$fig_disk/FIG/NR", 1]);
185      push(@$Config, ["temp", "$fig_disk/FIG/Tmp", 1]);      push(@$Config, ["temp", "$fig_disk/FIG/Tmp", 1]);
186      push(@$Config, ["temp_url", "http://$hostname/FIG-Tmp", 1]);      push(@$Config, ["sproutData", $sproutData, 1]);
187      push(@$Config, ["cgi_url", "http://$hostname/FIG", 1]);  
188        my $sandbox;
189        if ($ENV{FIGCONFIG_SANDBOX})
190        {
191            $sandbox = "/$ENV{FIGCONFIG_SANDBOX}";
192        }
193    
194        push(@$Config, ["temp_url", "http://$hostname$sandbox/FIG-Tmp", 1]);
195        push(@$Config, ["cgi_url", "http://$hostname$sandbox/FIG", 1]);
196    
197      #      #
198      # Add values for a relative base href of temp and CGI pages.  The latter      # Add values for a relative base href of temp and CGI pages.  The latter
# Line 155  Line 200 
200      # sense to derive the above 2 values from these.  -- GJO      # sense to derive the above 2 values from these.  -- GJO
201      #      #
202    
203      push(@$Config, ["temp_base", "/FIG-Tmp/", 1]);      push(@$Config, ["temp_base", "$sandbox/FIG-Tmp/", 1]);
204      push(@$Config, ["cgi_base", "/FIG/", 1]);      push(@$Config, ["cgi_base", "$sandbox/FIG/", 1]);
205    
206        push(@$Config, [ { perl => <<'END' }]);
207    sub compute_env_values
208    {
209        return if defined($FIG_Config::hosttype);
210    
211        open(CF, "<$FIG_Config::env_config_file") or
212            die "Cannot open $FIG_Config::env_config_file: $!";
213    
214        my $hostinfo = `bash -c 'echo \$HOSTTYPE \$HOSTNAME'`;
215        if ($hostinfo  !~ /^\s*(\S+)\s*(\S+)/)
216        {
217            die "Error retrieving hosttype; bash failed with rc=$?";
218        }
219        my $hosttype = $1;
220        my $hostname = $2;
221    
222        my %dat;
223        while (<CF>)
224        {
225            if (/^(\S+)\t(\S+)/)
226            {
227                $dat{$1} = $2;
228            }
229        }
230        close(CF);
231    
232        my $dir;
233        if ($dat{$hostname} ne '')
234        {
235            $dir = $dat{$hostname};
236        }
237        elsif ($dat{$hosttype} ne '')
238        {
239            $dir = $dat{$hosttype};
240        }
241        else
242        {
243            die "Could not find  config mapping for hostname $hostname and hosttype $hosttype\n";
244        }
245        $FIG_Config::common_runtime = $dir;
246        $FIG_Config::ext_bin = "$dir/bin";
247        $FIG_Config::hosttype = $hosttype;
248    }
249    END
250  }  }
251    
252  sub compute_environment  sub compute_environment
# Line 167  Line 257 
257    
258      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);
259      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);
260        push(@$Env, ["RTSITECONFIGDIR", "\$RTROOT/config", 0]);
261      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);
262      push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);      push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);
263      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);
# Line 181  Line 272 
272      #      #
273    
274      my @path = ();      my @path = ();
     push(@path, $env_bin);  
275      push(@path, $fig_bin);      push(@path, $fig_bin);
276        if ($env_config_type eq 'dir')
277        {
278            push(@path, $env_bin);
279        }
280      push(@path, "$fig_disk/bin");      push(@path, "$fig_disk/bin");
281    
282      push(@$Env, ["PATH", join(":", @path), 1]);      push(@$Env, ["PATH", join(":", @path), 1]);
283    
284      push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}", 1]);      #
285        # Compute  LD_LIBRARY_PATH.
286        #
287        # Some packages, like mysql, place their shared libs in subdirectories
288        # of the libdir.
289        #
290        # We can only do this if we're configured with an env dir.
291        #
292    
293        if ($env_config_type eq 'dir')
294        {
295            my @ld_path = ($env_lib);
296    
297            my $dh;
298            if (!opendir($dh, $env_lib))
299            {
300                warn "Could not opendir $env_lib: $!";
301            }
302    
303            while ($_ = readdir($dh))
304            {
305                next if /^\./;
306    
307                my $path = "$env_lib/$_";
308                next unless -d $path;
309    
310                #
311                # See if there are any .so's in here.
312                #
313    
314                my @solist = <$path/*.so*>;
315                if (@solist > 0)
316                {
317                    push(@ld_path, $path);
318                }
319            }
320            closedir($dh);
321    
322            #
323            # And if perl is dynamically linked, we need to add the perl core directory
324            # to the path too.
325            #
326    
327            my @coredir = <$env_lib/perl5/*/*/CORE>;
328            if (@coredir)
329            {
330                if ( -f "$coredir[0]/libperl.so" )
331                {
332                    print "Found libperl in $coredir[0]\n";
333                    push(@ld_path, $coredir[0]);
334                }
335            }
336    
337            my $ld_path = join(":", @ld_path);
338            $OtherConfig->{ld_library_path} = $ld_path;
339    
340            push(@$Env, ["LD_LIBRARY_PATH", $ld_path, 1]);
341        }
342    
343        #
344        # If we're configuring with an env dir, we start with our @INC that we
345        # found. Otherwise we just append.
346        #
347    
348        my @perllib;
349        if ($env_config_type eq 'dir')
350        {
351            @perllib = grep({ $_ ne "." } @INC);
352        }
353    
354        push(@perllib,
355             $release_lib,
356             "$release_lib/FigKernelPackages",
357             "$release_lib/WebApplication",
358             "$release_lib/FortyEight",
359             "$release_lib/PPO",
360             "$fig_disk/config");
361    
362        push(@$Env, ["PERL5LIB", join(":", @perllib), 1]);
363  }  }
364    
365  sub configure_python  sub configure_python
# Line 203  Line 375 
375      # and to packages that were installed in the environment dir.      # and to packages that were installed in the environment dir.
376      #      #
377    
378      my $python = find_python();      my $python = find_python(1);
379      print "Found python at $python\n";      print "Found python at $python\n";
380    
381      my $py_version = `$python -c 'import sys; print "%d.%d" % (sys.version_info[:2])'`;      my $py_version = `$python -c 'import sys; print "%d.%d" % (sys.version_info[:2])'`;
382      chomp $py_version;      chomp $py_version;
383      print "Python version $py_version\n";      print "Python version $py_version\n";
384    
385      $OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";      #
386        # Python figures this out for us.
387        #$OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";
388    
389      my @path = ();      my @path = ();
390      push(@path, $OtherConfig->{python_site_path});      #push(@path, $OtherConfig->{python_site_path});
391      push(@path, "$release_lib");      push(@path, "$release_lib");
392      push(@path, "$fig_disk/config");      push(@path, "$fig_disk/config");
393      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);
# Line 242  Line 416 
416  #  #
417  sub find_python  sub find_python
418  {  {
419        my($to_exec) = @_;
420      my $python;      my $python;
421    
422        if (!$to_exec and $env_config_type eq 'config_file')
423        {
424            return $run_python;
425        }
426    
427      #      #
428      # Special case for the mac.      # Special case for the mac.
429      #      #
430        # RDO 20040603 - don't do this any more; we want to pick up
431        # the python we ship.
432        #
433    
434      if ($ENV{FIGCONFIG_ENV} eq "mac")      if (0 && $ENV{FIGCONFIG_ENV} eq "mac")
435      {      {
436          #          #
437          # We'd like to use the MacPython that is installed          # We'd like to use the MacPython that is installed
# Line 272  Line 455 
455      $python = "$ENV{FIGCONFIG_ENV_DIR}/bin/python";      $python = "$ENV{FIGCONFIG_ENV_DIR}/bin/python";
456      if (-x $python)      if (-x $python)
457      {      {
458            #
459            # The mac doesn't seem to like the long #! lines, so we'll use poundbang env.
460            #
461            if ($ENV{FIGCONFIG_ENV} =~ /^mac/)
462            {
463                $OtherConfig->{python_require_poundbang_env} = 1;
464            }
465          return $python;          return $python;
466      }      }
467    
# Line 285  Line 475 
475  {  {
476      my $perl;      my $perl;
477    
478        if ($env_config_type eq 'config_file')
479        {
480            return $run_perl;
481        }
482    
483      $perl = "$ENV{FIGCONFIG_ENV_DIR}/bin/perl";      $perl = "$ENV{FIGCONFIG_ENV_DIR}/bin/perl";
484      if (-x $perl)      if (-x $perl)
485      {      {
# Line 324  Line 519 
519              print $fh "export $name\n";              print $fh "export $name\n";
520          }          }
521      }      }
522    
523        #
524        # If we're configuring from a config file, add the code to set up the PATH with the
525        # right ext_bin.
526        #
527        if ($env_config_type eq 'config_file')
528        {
529            print $fh "export FIG_ENV_CONFIG_FILE='$env_config_file'\n";
530            print $fh <<'END';
531    env_dir=`awk "\\$1 == \"$HOSTNAME\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
532    if [ "$env_dir" = "" ] ; then
533         env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
534    fi
535    export PATH=$env_dir/bin:${PATH}
536    END
537        }
538    
539        print $fh "alias rtpath='source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.sh'\n";
540  }  }
541    
542  sub write_csh_init  sub write_csh_init
# Line 354  Line 567 
567          }          }
568      }      }
569    
570        #
571        # Alias for RT stuff.
572        #
573        print $fh "alias rtpath 'source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.csh'\n";
574  }  }
575    
576  sub run_script  sub run_script
# Line 432  Line 649 
649    
650  }  }
651    
652    sub write_run_perl
653    {
654        unlink($run_perl);
655        open(F, ">$run_perl") or die "Cannot write $run_perl: $!";
656    
657        print F "#!/bin/sh\n\n";
658    
659        print F ". $fig_disk/config/fig-user-env.sh\n\n";
660    
661        if ($env_config_type eq 'config_file')
662        {
663            print F <<'END';
664    env_dir=`awk "\\$1 == \"$HOSTNAME\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
665    if [ "$env_dir" = "" ] ; then
666         env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
667    fi
668    perl="$env_dir/bin/perl"
669    END
670        }
671        else
672        {
673            print F "perl=$env_dir/bin/perl\n";
674        }
675        print F 'exec $perl "$@"' . "\n";
676        close(F);
677        chmod(0775, $run_perl);
678    }
679    
680    sub write_run_python
681    {
682        unlink($run_python);
683        open(F, ">$run_python") or die "Cannot write $run_python: $!";
684    
685        print F "#!/bin/sh\n\n";
686    
687        print F ". $fig_disk/config/fig-user-env.sh\n\n";
688    
689        if ($env_config_type eq 'config_file')
690        {
691            print F <<'END';
692    env_dir=`awk "\\$1 == \"$HOSTNAME\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
693    if [ "$env_dir" = "" ] ; then
694         env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
695    fi
696    python="$env_dir/bin/python"
697    END
698        }
699        else
700        {
701            print F "python=$env_dir/bin/python\n";
702        }
703        print F 'exec $python "$@"' . "\n";
704        close(F);
705        chmod(0775, $run_python);
706    }
707    
708  sub finalize_server_scripts  sub finalize_server_scripts
709  {  {
710      #      #
# Line 460  Line 733 
733      {      {
734          my($name, $value, $quote) = @$item;          my($name, $value, $quote) = @$item;
735    
736            #
737            # special code for non-var=value items.
738            #
739            if (ref($name) eq 'HASH')
740            {
741                my $l = $name->{perl};
742                if ($l ne '')
743                {
744                    print $fh "$l\n";
745                }
746            }
747            else
748            {
749          my $q = $quote ? '"' : '';          my $q = $quote ? '"' : '';
750          printf $fh "\$%-15s = $q$value$q;\n", $name              printf $fh "\$%-15s = $q$value$q;\n", $name;
751            }
752      }      }
753    
754      print $fh "\n1;\n";      print $fh "\n1;\n";
# Line 476  Line 763 
763          my($name, $value, $quote) = @$item;          my($name, $value, $quote) = @$item;
764    
765          #          #
766            # special code for non-var=value items.
767            #
768            if (ref($name) eq 'HASH')
769            {
770                my $l = $name->{python};
771                if ($l ne '')
772                {
773                    print $fh "$l\n";
774                }
775            }
776            else
777            {
778                #
779          # Ugh. "global" is a keyword in python.          # Ugh. "global" is a keyword in python.
780          #          #
781    
782          $name = "global_dir" if $name eq "global";          $name = "global_dir" if $name eq "global";
783    
784          my $q = $quote ? '"' : '';          my $q = $quote ? '"' : '';
785          printf $fh "%-15s = $q$value$q\n", $name              printf $fh "%-15s = $q$value$q\n", $name;
786            }
787      }      }
788  }  }
789    
# Line 534  Line 835 
835    
836      print $fh "use FIG_Config;\n";      print $fh "use FIG_Config;\n";
837      print $fh "\n";      print $fh "\n";
838        print $fh "#### END tool_hdr ####\n\n"
839  }  }
840    
841  sub write_tool_hdr_python  sub write_tool_hdr_python
# Line 552  Line 854 
854      }      }
855      print $fh "\n";      print $fh "\n";
856    
857      print $fh "import sys\n";      print $fh "import sys, os\n";
858    
859    
860      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";
861    
862        #
863        # Append the perl path to the environment, for use later with CallPerl.
864        #
865    
866        my $perlpath = join(":", @INC, $release_lib, "$release_lib/FigKernelPackages", "$fig_disk/config");
867        print $fh <<END;
868    if os.getenv("PERL5LIB", "") != "":
869        _delim = ":"
870    else:
871        _delim = ""
872    os.environ["PERL5LIB"] = "$perlpath" + _delim + os.getenv("PERL5LIB", "")
873    
874    END
875    
876      print $fh "# Following block is expanded by switch_to_release to add use lib directives\n";      print $fh "# Following block is expanded by switch_to_release to add use lib directives\n";
877      print $fh "# to point at the correct locations in the release directory.\n";      print $fh "# to point at the correct locations in the release directory.\n";
878      print $fh "#BEGIN switch_to_release generated code\n";      print $fh "#BEGIN switch_to_release generated code\n";
# Line 567  Line 883 
883    
884      print $fh "import FIG_Config\n";      print $fh "import FIG_Config\n";
885      print $fh "\n";      print $fh "\n";
886        print $fh "#### END tool_hdr_py ####\n\n"
887    }
888    
889    sub write_rtconfig
890    {
891        my($fh) = @_;
892    
893        my $python = find_python();
894        my $perl = find_perl();
895    
896        print $fh "RTPYTHON=$python\n";
897        print $fh "RTPERL=$perl\n";
898        print $fh "RTPYTHONPATH=$OtherConfig->{pythonpath}\n";
899    
900        my %seen;
901        my @perlpath;
902    
903        my @dirs;
904        if ($env_config_type eq 'dir')
905        {
906            push(@dirs, @INC);
907        }
908        push(@dirs, "$fig_disk/config");
909        for (@dirs)
910        {
911            next if $seen{$_};
912            push(@perlpath, $_);
913            $seen{$_}++;
914        }
915        my $perlpath = join(":", @perlpath);
916    
917        print $fh "RTPERL5LIB=$perlpath\n";
918    
919        print $fh "RTPYTHONIMPORTS=FIG_Config\n";
920        print $fh "RTPERLIMPORTS=FIG_Config\n";
921        print $fh "RTSETENV=BLASTMAT=$fig_disk/BLASTMAT\n";
922        print $fh "RTSETENV=FIG_HOME=$fig_disk\n";
923        print $fh "#RTLD_LDPATH=$OtherConfig->{ld_library_path}\n";
924  }  }
925    
926  setup_directories("$fig_disk/bin",  setup_directories("$fig_disk/bin",
927                    "$fig_disk/config");                    "$fig_disk/config");
928    
929  setup_server_scripts();  setup_server_scripts();
930    write_run_perl();
931    write_run_python();
932    
933  find_python();  find_python();
934    
# Line 581  Line 936 
936  configure_std_fig_environment();  configure_std_fig_environment();
937  configure_python();  configure_python();
938  configure_environment_specific();  configure_environment_specific();
939    # configure_database();
940    
941  finalize_server_scripts();  finalize_server_scripts();
942    
# Line 619  Line 975 
975  write_tool_hdr_python(\*FH);  write_tool_hdr_python(\*FH);
976  close(FH);  close(FH);
977    
978    open(FH, ">$fig_disk/config/RTConfig") or die "Cannot write $fig_disk/config/RTConfig: $!";
979    write_rtconfig(\*FH);
980    close(FH);
981    
982  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");
983    
984  require FigCommon::SwitchRelease;  require FigCommon::SwitchRelease;
985    
986    #
987    # We need to tweak the current path and PERL5LIB environment to get bootstrapping to
988    # work correctly.
989    #
990    
991    $ENV{PATH} = "$ENV{FIGCONFIG_ENVDIR}/bin:$ENV{PATH}";
992    
993    $ENV{PERL5LIB} = (map { $_->[1] } grep { $_->[0] eq "PERL5LIB"} @$Env)[0];
994    
995  &FigCommon::SwitchRelease::switch_to_release($fig_disk, $ENV{FIGCONFIG_ENV}, $ENV{FIGCONFIG_RELEASE});  &FigCommon::SwitchRelease::switch_to_release($fig_disk, $ENV{FIGCONFIG_ENV}, $ENV{FIGCONFIG_RELEASE});

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.36

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3