[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.31, Tue Nov 27 23:16:21 2007 UTC revision 1.32, Tue Dec 4 20:09:03 2007 UTC
# Line 66  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 145  Line 145 
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";  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 359  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])'`;
# Line 400  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      #      #
# Line 646  Line 653 
653      }      }
654      print F 'exec $perl "$@"' . "\n";      print F 'exec $perl "$@"' . "\n";
655      close(F);      close(F);
656        chmod(0775, $run_perl);
657    }
658    
659    sub write_run_python
660    {
661        unlink($run_python);
662        open(F, ">$run_python") or die "Cannot write $run_python: $!";
663    
664        print F "#!/bin/sh\n\n";
665    
666        print F ". $fig_disk/config/fig-user-env.sh\n\n";
667    
668        if ($env_config_type eq 'config_file')
669        {
670            print F <<'END';
671    env_dir=`awk "\\$1 == \"$HOSTTYPE\" { print \\$2 }" $FIG_ENV_CONFIG_FILE`
672    python="$env_dir/bin/python"
673    END
674        }
675        else
676        {
677            print F "python=$env_dir/bin/python\n";
678        }
679        print F 'exec $python "$@"' . "\n";
680        close(F);
681        chmod(0775, $run_python);
682  }  }
683    
684  sub finalize_server_scripts  sub finalize_server_scripts
# Line 843  Line 875 
875    
876      my %seen;      my %seen;
877      my @perlpath;      my @perlpath;
878      for (@INC, "$fig_disk/config")  
879        my @dirs;
880        if ($env_config_type eq 'dir')
881        {
882            push(@dirs, @INC);
883        }
884        push(@dirs, "$fig_disk/config");
885        for (@dirs)
886      {      {
887          next if $seen{$_};          next if $seen{$_};
888          push(@perlpath, $_);          push(@perlpath, $_);
# Line 865  Line 904 
904    
905  setup_server_scripts();  setup_server_scripts();
906  write_run_perl();  write_run_perl();
907    write_run_python();
908    
909  find_python();  find_python();
910    

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3