[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.34, Wed Dec 12 22:42:05 2007 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        my $hosttype = `bash -c 'echo \$HOSTTYPE'`;
212        if ($hosttype eq '')
213        {
214            die "Error retrieving hosttype; bash failed with rc=$?";
215        }
216        chomp $hosttype;
217        open(CF, "<$FIG_Config::env_config_file") or
218            die "Cannot open $FIG_Config::env_config_file: $!";
219        my $found;
220        while (<CF>)
221        {
222            if (/^$hosttype\t(\S+)/)
223            {
224                $found++;
225                $FIG_Config::common_runtime = $1;
226                $FIG_Config::ext_bin = "$1/bin";
227                $FIG_Config::hosttype = $hosttype;
228                $found++;
229                last;
230            }
231        }
232        $found or die "Could not find binary directory for hosttype $hosttype in $FIG_Config::env_config_file";
233    }
234    END
235  }  }
236    
237  sub compute_environment  sub compute_environment
# Line 167  Line 242 
242    
243      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);
244      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);
245        push(@$Env, ["RTSITECONFIGDIR", "\$RTROOT/config", 0]);
246      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);
247      push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);      push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);
248      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);
# Line 181  Line 257 
257      #      #
258    
259      my @path = ();      my @path = ();
     push(@path, $env_bin);  
260      push(@path, $fig_bin);      push(@path, $fig_bin);
261        if ($env_config_type eq 'dir')
262        {
263            push(@path, $env_bin);
264        }
265      push(@path, "$fig_disk/bin");      push(@path, "$fig_disk/bin");
266    
267      push(@$Env, ["PATH", join(":", @path), 1]);      push(@$Env, ["PATH", join(":", @path), 1]);
268    
269      push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}", 1]);      #
270        # Compute  LD_LIBRARY_PATH.
271        #
272        # Some packages, like mysql, place their shared libs in subdirectories
273        # of the libdir.
274        #
275        # We can only do this if we're configured with an env dir.
276        #
277    
278        if ($env_config_type eq 'dir')
279        {
280            my @ld_path = ($env_lib);
281    
282            my $dh;
283            if (!opendir($dh, $env_lib))
284            {
285                warn "Could not opendir $env_lib: $!";
286            }
287    
288            while ($_ = readdir($dh))
289            {
290                next if /^\./;
291    
292                my $path = "$env_lib/$_";
293                next unless -d $path;
294    
295                #
296                # See if there are any .so's in here.
297                #
298    
299                my @solist = <$path/*.so*>;
300                if (@solist > 0)
301                {
302                    push(@ld_path, $path);
303                }
304            }
305            closedir($dh);
306    
307            #
308            # And if perl is dynamically linked, we need to add the perl core directory
309            # to the path too.
310            #
311    
312            my @coredir = <$env_lib/perl5/*/*/CORE>;
313            if (@coredir)
314            {
315                if ( -f "$coredir[0]/libperl.so" )
316                {
317                    print "Found libperl in $coredir[0]\n";
318                    push(@ld_path, $coredir[0]);
319                }
320            }
321    
322            my $ld_path = join(":", @ld_path);
323            $OtherConfig->{ld_library_path} = $ld_path;
324    
325            push(@$Env, ["LD_LIBRARY_PATH", $ld_path, 1]);
326        }
327    
328        #
329        # If we're configuring with an env dir, we start with our @INC that we
330        # found. Otherwise we just append.
331        #
332    
333        my @perllib;
334        if ($env_config_type eq 'dir')
335        {
336            @perllib = grep({ $_ ne "." } @INC);
337        }
338    
339        push(@perllib,
340             $release_lib,
341             "$release_lib/FigKernelPackages",
342             "$release_lib/WebApplication",
343             "$release_lib/FortyEight",
344             "$release_lib/PPO",
345             "$fig_disk/config");
346    
347        push(@$Env, ["PERL5LIB", join(":", @perllib), 1]);
348  }  }
349    
350  sub configure_python  sub configure_python
# Line 203  Line 360 
360      # and to packages that were installed in the environment dir.      # and to packages that were installed in the environment dir.
361      #      #
362    
363      my $python = find_python();      my $python = find_python(1);
364      print "Found python at $python\n";      print "Found python at $python\n";
365    
366      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])'`;
367      chomp $py_version;      chomp $py_version;
368      print "Python version $py_version\n";      print "Python version $py_version\n";
369    
370      $OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";      #
371        # Python figures this out for us.
372        #$OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";
373    
374      my @path = ();      my @path = ();
375      push(@path, $OtherConfig->{python_site_path});      #push(@path, $OtherConfig->{python_site_path});
376      push(@path, "$release_lib");      push(@path, "$release_lib");
377      push(@path, "$fig_disk/config");      push(@path, "$fig_disk/config");
378      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);
# Line 242  Line 401 
401  #  #
402  sub find_python  sub find_python
403  {  {
404        my($to_exec) = @_;
405      my $python;      my $python;
406    
407        if (!$to_exec and $env_config_type eq 'config_file')
408        {
409            return $run_python;
410        }
411    
412      #      #
413      # Special case for the mac.      # Special case for the mac.
414      #      #
415        # RDO 20040603 - don't do this any more; we want to pick up
416        # the python we ship.
417        #
418    
419      if ($ENV{FIGCONFIG_ENV} eq "mac")      if (0 && $ENV{FIGCONFIG_ENV} eq "mac")
420      {      {
421          #          #
422          # We'd like to use the MacPython that is installed          # We'd like to use the MacPython that is installed
# Line 272  Line 440 
440      $python = "$ENV{FIGCONFIG_ENV_DIR}/bin/python";      $python = "$ENV{FIGCONFIG_ENV_DIR}/bin/python";
441      if (-x $python)      if (-x $python)
442      {      {
443            #
444            # The mac doesn't seem to like the long #! lines, so we'll use poundbang env.
445            #
446            if ($ENV{FIGCONFIG_ENV} =~ /^mac/)
447            {
448                $OtherConfig->{python_require_poundbang_env} = 1;
449            }
450          return $python;          return $python;
451      }      }
452    
# Line 285  Line 460 
460  {  {
461      my $perl;      my $perl;
462    
463        if ($env_config_type eq 'config_file')
464        {
465            return $run_perl;
466        }
467    
468      $perl = "$ENV{FIGCONFIG_ENV_DIR}/bin/perl";      $perl = "$ENV{FIGCONFIG_ENV_DIR}/bin/perl";
469      if (-x $perl)      if (-x $perl)
470      {      {
# Line 324  Line 504 
504              print $fh "export $name\n";              print $fh "export $name\n";
505          }          }
506      }      }
507    
508        #
509        # If we're configuring from a config file, add the code to set up the PATH with the
510        # right ext_bin.
511        #
512        if ($env_config_type eq 'config_file')
513        {
514            print $fh "export FIG_ENV_CONFIG_FILE='$env_config_file'\n";
515            print $fh <<'END';
516    env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
517    export PATH=$env_dir/bin:${PATH}
518    END
519        }
520    
521        print $fh "alias rtpath='source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.sh'\n";
522  }  }
523    
524  sub write_csh_init  sub write_csh_init
# Line 354  Line 549 
549          }          }
550      }      }
551    
552        #
553        # Alias for RT stuff.
554        #
555        print $fh "alias rtpath 'source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.csh'\n";
556  }  }
557    
558  sub run_script  sub run_script
# Line 432  Line 631 
631    
632  }  }
633    
634    sub write_run_perl
635    {
636        unlink($run_perl);
637        open(F, ">$run_perl") or die "Cannot write $run_perl: $!";
638    
639        print F "#!/bin/sh\n\n";
640    
641        print F ". $fig_disk/config/fig-user-env.sh\n\n";
642    
643        if ($env_config_type eq 'config_file')
644        {
645            print F <<'END';
646    env_dir=`awk "\\$1 == \"$HOSTNAME\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
647    if [ "$env_dir" = "" ] ; then
648         env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
649    fi
650    perl="$env_dir/bin/perl"
651    END
652        }
653        else
654        {
655            print F "perl=$env_dir/bin/perl\n";
656        }
657        print F 'exec $perl "$@"' . "\n";
658        close(F);
659        chmod(0775, $run_perl);
660    }
661    
662    sub write_run_python
663    {
664        unlink($run_python);
665        open(F, ">$run_python") or die "Cannot write $run_python: $!";
666    
667        print F "#!/bin/sh\n\n";
668    
669        print F ". $fig_disk/config/fig-user-env.sh\n\n";
670    
671        if ($env_config_type eq 'config_file')
672        {
673            print F <<'END';
674    env_dir=`awk "\\$1 == \"$HOSTNAME\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
675    if [ "$env_dir" = "" ] ; then
676         env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
677    fi
678    python="$env_dir/bin/python"
679    END
680        }
681        else
682        {
683            print F "python=$env_dir/bin/python\n";
684        }
685        print F 'exec $python "$@"' . "\n";
686        close(F);
687        chmod(0775, $run_python);
688    }
689    
690  sub finalize_server_scripts  sub finalize_server_scripts
691  {  {
692      #      #
# Line 460  Line 715 
715      {      {
716          my($name, $value, $quote) = @$item;          my($name, $value, $quote) = @$item;
717    
718            #
719            # special code for non-var=value items.
720            #
721            if (ref($name) eq 'HASH')
722            {
723                my $l = $name->{perl};
724                if ($l ne '')
725                {
726                    print $fh "$l\n";
727                }
728            }
729            else
730            {
731          my $q = $quote ? '"' : '';          my $q = $quote ? '"' : '';
732          printf $fh "\$%-15s = $q$value$q;\n", $name              printf $fh "\$%-15s = $q$value$q;\n", $name;
733            }
734      }      }
735    
736      print $fh "\n1;\n";      print $fh "\n1;\n";
# Line 476  Line 745 
745          my($name, $value, $quote) = @$item;          my($name, $value, $quote) = @$item;
746    
747          #          #
748            # special code for non-var=value items.
749            #
750            if (ref($name) eq 'HASH')
751            {
752                my $l = $name->{python};
753                if ($l ne '')
754                {
755                    print $fh "$l\n";
756                }
757            }
758            else
759            {
760                #
761          # Ugh. "global" is a keyword in python.          # Ugh. "global" is a keyword in python.
762          #          #
763    
764          $name = "global_dir" if $name eq "global";          $name = "global_dir" if $name eq "global";
765    
766          my $q = $quote ? '"' : '';          my $q = $quote ? '"' : '';
767          printf $fh "%-15s = $q$value$q\n", $name              printf $fh "%-15s = $q$value$q\n", $name;
768            }
769      }      }
770  }  }
771    
# Line 534  Line 817 
817    
818      print $fh "use FIG_Config;\n";      print $fh "use FIG_Config;\n";
819      print $fh "\n";      print $fh "\n";
820        print $fh "#### END tool_hdr ####\n\n"
821  }  }
822    
823  sub write_tool_hdr_python  sub write_tool_hdr_python
# Line 552  Line 836 
836      }      }
837      print $fh "\n";      print $fh "\n";
838    
839      print $fh "import sys\n";      print $fh "import sys, os\n";
840    
841    
842      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";
843    
844        #
845        # Append the perl path to the environment, for use later with CallPerl.
846        #
847    
848        my $perlpath = join(":", @INC, $release_lib, "$release_lib/FigKernelPackages", "$fig_disk/config");
849        print $fh <<END;
850    if os.getenv("PERL5LIB", "") != "":
851        _delim = ":"
852    else:
853        _delim = ""
854    os.environ["PERL5LIB"] = "$perlpath" + _delim + os.getenv("PERL5LIB", "")
855    
856    END
857    
858      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";
859      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";
860      print $fh "#BEGIN switch_to_release generated code\n";      print $fh "#BEGIN switch_to_release generated code\n";
# Line 567  Line 865 
865    
866      print $fh "import FIG_Config\n";      print $fh "import FIG_Config\n";
867      print $fh "\n";      print $fh "\n";
868        print $fh "#### END tool_hdr_py ####\n\n"
869    }
870    
871    sub write_rtconfig
872    {
873        my($fh) = @_;
874    
875        my $python = find_python();
876        my $perl = find_perl();
877    
878        print $fh "RTPYTHON=$python\n";
879        print $fh "RTPERL=$perl\n";
880        print $fh "RTPYTHONPATH=$OtherConfig->{pythonpath}\n";
881    
882        my %seen;
883        my @perlpath;
884    
885        my @dirs;
886        if ($env_config_type eq 'dir')
887        {
888            push(@dirs, @INC);
889        }
890        push(@dirs, "$fig_disk/config");
891        for (@dirs)
892        {
893            next if $seen{$_};
894            push(@perlpath, $_);
895            $seen{$_}++;
896        }
897        my $perlpath = join(":", @perlpath);
898    
899        print $fh "RTPERL5LIB=$perlpath\n";
900    
901        print $fh "RTPYTHONIMPORTS=FIG_Config\n";
902        print $fh "RTPERLIMPORTS=FIG_Config\n";
903        print $fh "RTSETENV=BLASTMAT=$fig_disk/BLASTMAT\n";
904        print $fh "RTSETENV=FIG_HOME=$fig_disk\n";
905        print $fh "#RTLD_LDPATH=$OtherConfig->{ld_library_path}\n";
906  }  }
907    
908  setup_directories("$fig_disk/bin",  setup_directories("$fig_disk/bin",
909                    "$fig_disk/config");                    "$fig_disk/config");
910    
911  setup_server_scripts();  setup_server_scripts();
912    write_run_perl();
913    write_run_python();
914    
915  find_python();  find_python();
916    
# Line 581  Line 918 
918  configure_std_fig_environment();  configure_std_fig_environment();
919  configure_python();  configure_python();
920  configure_environment_specific();  configure_environment_specific();
921    # configure_database();
922    
923  finalize_server_scripts();  finalize_server_scripts();
924    
# Line 619  Line 957 
957  write_tool_hdr_python(\*FH);  write_tool_hdr_python(\*FH);
958  close(FH);  close(FH);
959    
960    open(FH, ">$fig_disk/config/RTConfig") or die "Cannot write $fig_disk/config/RTConfig: $!";
961    write_rtconfig(\*FH);
962    close(FH);
963    
964  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");
965    
966  require FigCommon::SwitchRelease;  require FigCommon::SwitchRelease;
967    
968    #
969    # We need to tweak the current path and PERL5LIB environment to get bootstrapping to
970    # work correctly.
971    #
972    
973    $ENV{PATH} = "$ENV{FIGCONFIG_ENVDIR}/bin:$ENV{PATH}";
974    
975    $ENV{PERL5LIB} = (map { $_->[1] } grep { $_->[0] eq "PERL5LIB"} @$Env)[0];
976    
977  &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.34

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3