[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.35, Wed Jan 2 17:52:55 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 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
532    export PATH=$env_dir/bin:${PATH}
533    END
534        }
535    
536        print $fh "alias rtpath='source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.sh'\n";
537  }  }
538    
539  sub write_csh_init  sub write_csh_init
# Line 354  Line 564 
564          }          }
565      }      }
566    
567        #
568        # Alias for RT stuff.
569        #
570        print $fh "alias rtpath 'source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.csh'\n";
571  }  }
572    
573  sub run_script  sub run_script
# Line 432  Line 646 
646    
647  }  }
648    
649    sub write_run_perl
650    {
651        unlink($run_perl);
652        open(F, ">$run_perl") or die "Cannot write $run_perl: $!";
653    
654        print F "#!/bin/sh\n\n";
655    
656        print F ". $fig_disk/config/fig-user-env.sh\n\n";
657    
658        if ($env_config_type eq 'config_file')
659        {
660            print F <<'END';
661    env_dir=`awk "\\$1 == \"$HOSTNAME\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
662    if [ "$env_dir" = "" ] ; then
663         env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
664    fi
665    perl="$env_dir/bin/perl"
666    END
667        }
668        else
669        {
670            print F "perl=$env_dir/bin/perl\n";
671        }
672        print F 'exec $perl "$@"' . "\n";
673        close(F);
674        chmod(0775, $run_perl);
675    }
676    
677    sub write_run_python
678    {
679        unlink($run_python);
680        open(F, ">$run_python") or die "Cannot write $run_python: $!";
681    
682        print F "#!/bin/sh\n\n";
683    
684        print F ". $fig_disk/config/fig-user-env.sh\n\n";
685    
686        if ($env_config_type eq 'config_file')
687        {
688            print F <<'END';
689    env_dir=`awk "\\$1 == \"$HOSTNAME\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
690    if [ "$env_dir" = "" ] ; then
691         env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
692    fi
693    python="$env_dir/bin/python"
694    END
695        }
696        else
697        {
698            print F "python=$env_dir/bin/python\n";
699        }
700        print F 'exec $python "$@"' . "\n";
701        close(F);
702        chmod(0775, $run_python);
703    }
704    
705  sub finalize_server_scripts  sub finalize_server_scripts
706  {  {
707      #      #
# Line 460  Line 730 
730      {      {
731          my($name, $value, $quote) = @$item;          my($name, $value, $quote) = @$item;
732    
733            #
734            # special code for non-var=value items.
735            #
736            if (ref($name) eq 'HASH')
737            {
738                my $l = $name->{perl};
739                if ($l ne '')
740                {
741                    print $fh "$l\n";
742                }
743            }
744            else
745            {
746          my $q = $quote ? '"' : '';          my $q = $quote ? '"' : '';
747          printf $fh "\$%-15s = $q$value$q;\n", $name              printf $fh "\$%-15s = $q$value$q;\n", $name;
748            }
749      }      }
750    
751      print $fh "\n1;\n";      print $fh "\n1;\n";
# Line 476  Line 760 
760          my($name, $value, $quote) = @$item;          my($name, $value, $quote) = @$item;
761    
762          #          #
763            # special code for non-var=value items.
764            #
765            if (ref($name) eq 'HASH')
766            {
767                my $l = $name->{python};
768                if ($l ne '')
769                {
770                    print $fh "$l\n";
771                }
772            }
773            else
774            {
775                #
776          # Ugh. "global" is a keyword in python.          # Ugh. "global" is a keyword in python.
777          #          #
778    
779          $name = "global_dir" if $name eq "global";          $name = "global_dir" if $name eq "global";
780    
781          my $q = $quote ? '"' : '';          my $q = $quote ? '"' : '';
782          printf $fh "%-15s = $q$value$q\n", $name              printf $fh "%-15s = $q$value$q\n", $name;
783            }
784      }      }
785  }  }
786    
# Line 534  Line 832 
832    
833      print $fh "use FIG_Config;\n";      print $fh "use FIG_Config;\n";
834      print $fh "\n";      print $fh "\n";
835        print $fh "#### END tool_hdr ####\n\n"
836  }  }
837    
838  sub write_tool_hdr_python  sub write_tool_hdr_python
# Line 552  Line 851 
851      }      }
852      print $fh "\n";      print $fh "\n";
853    
854      print $fh "import sys\n";      print $fh "import sys, os\n";
855    
856    
857      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";
858    
859        #
860        # Append the perl path to the environment, for use later with CallPerl.
861        #
862    
863        my $perlpath = join(":", @INC, $release_lib, "$release_lib/FigKernelPackages", "$fig_disk/config");
864        print $fh <<END;
865    if os.getenv("PERL5LIB", "") != "":
866        _delim = ":"
867    else:
868        _delim = ""
869    os.environ["PERL5LIB"] = "$perlpath" + _delim + os.getenv("PERL5LIB", "")
870    
871    END
872    
873      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";
874      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";
875      print $fh "#BEGIN switch_to_release generated code\n";      print $fh "#BEGIN switch_to_release generated code\n";
# Line 567  Line 880 
880    
881      print $fh "import FIG_Config\n";      print $fh "import FIG_Config\n";
882      print $fh "\n";      print $fh "\n";
883        print $fh "#### END tool_hdr_py ####\n\n"
884    }
885    
886    sub write_rtconfig
887    {
888        my($fh) = @_;
889    
890        my $python = find_python();
891        my $perl = find_perl();
892    
893        print $fh "RTPYTHON=$python\n";
894        print $fh "RTPERL=$perl\n";
895        print $fh "RTPYTHONPATH=$OtherConfig->{pythonpath}\n";
896    
897        my %seen;
898        my @perlpath;
899    
900        my @dirs;
901        if ($env_config_type eq 'dir')
902        {
903            push(@dirs, @INC);
904        }
905        push(@dirs, "$fig_disk/config");
906        for (@dirs)
907        {
908            next if $seen{$_};
909            push(@perlpath, $_);
910            $seen{$_}++;
911        }
912        my $perlpath = join(":", @perlpath);
913    
914        print $fh "RTPERL5LIB=$perlpath\n";
915    
916        print $fh "RTPYTHONIMPORTS=FIG_Config\n";
917        print $fh "RTPERLIMPORTS=FIG_Config\n";
918        print $fh "RTSETENV=BLASTMAT=$fig_disk/BLASTMAT\n";
919        print $fh "RTSETENV=FIG_HOME=$fig_disk\n";
920        print $fh "#RTLD_LDPATH=$OtherConfig->{ld_library_path}\n";
921  }  }
922    
923  setup_directories("$fig_disk/bin",  setup_directories("$fig_disk/bin",
924                    "$fig_disk/config");                    "$fig_disk/config");
925    
926  setup_server_scripts();  setup_server_scripts();
927    write_run_perl();
928    write_run_python();
929    
930  find_python();  find_python();
931    
# Line 581  Line 933 
933  configure_std_fig_environment();  configure_std_fig_environment();
934  configure_python();  configure_python();
935  configure_environment_specific();  configure_environment_specific();
936    # configure_database();
937    
938  finalize_server_scripts();  finalize_server_scripts();
939    
# Line 619  Line 972 
972  write_tool_hdr_python(\*FH);  write_tool_hdr_python(\*FH);
973  close(FH);  close(FH);
974    
975    open(FH, ">$fig_disk/config/RTConfig") or die "Cannot write $fig_disk/config/RTConfig: $!";
976    write_rtconfig(\*FH);
977    close(FH);
978    
979  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");
980    
981  require FigCommon::SwitchRelease;  require FigCommon::SwitchRelease;
982    
983    #
984    # We need to tweak the current path and PERL5LIB environment to get bootstrapping to
985    # work correctly.
986    #
987    
988    $ENV{PATH} = "$ENV{FIGCONFIG_ENVDIR}/bin:$ENV{PATH}";
989    
990    $ENV{PERL5LIB} = (map { $_->[1] } grep { $_->[0] eq "PERL5LIB"} @$Env)[0];
991    
992  &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.35

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3