[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.3, Tue Dec 23 17:56:32 2003 UTC revision 1.8, Mon Feb 16 17:14:38 2004 UTC
# Line 102  Line 102 
102    
103  our $fig_disk = $ENV{FIG_HOME};  our $fig_disk = $ENV{FIG_HOME};
104  our $env_name = $ENV{FIGCONFIG_ENV};  our $env_name = $ENV{FIGCONFIG_ENV};
105    our $env_dir = "$ENV{FIGCONFIG_ENV_DIR}";
106  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";
107  our $env_lib = "$ENV{FIGCONFIG_ENV_DIR}/lib";  our $env_lib = "$ENV{FIGCONFIG_ENV_DIR}/lib";
108  #  #
# Line 111  Line 112 
112  #our $release_bin = "$ENV{FIGCONFIG_RELEASE_DIR}/bin/$ENV{FIGCONFIG_ENV}";  #our $release_bin = "$ENV{FIGCONFIG_RELEASE_DIR}/bin/$ENV{FIGCONFIG_ENV}";
113  #our $release_lib = "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}";  #our $release_lib = "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}";
114    
115  our $release_bin = "$fig_disk/dist/releases/current/bin/$ENV{FIGCONFIG_ENV}";  our $release_bin = "$fig_disk/dist/releases/current/$ENV{FIGCONFIG_ENV}/bin";
116  our $release_lib = "$fig_disk/dist/releases/current/lib/$ENV{FIGCONFIG_ENV}";  our $release_lib = "$fig_disk/dist/releases/current/$ENV{FIGCONFIG_ENV}/lib";
117    
118  our $fig_bin = "$fig_disk/FIG/bin";  our $fig_bin = "$fig_disk/FIG/bin";
119    
# Line 135  Line 136 
136      chomp $hostname;      chomp $hostname;
137    
138      push(@$Config, ["fig_disk", $fig_disk, 1]);      push(@$Config, ["fig_disk", $fig_disk, 1]);
139      push(@$Config, ["blastmast", "$fig_disk/BLASTMAT", 1]);      push(@$Config, ["blastmat", "$fig_disk/BLASTMAT", 1]);
140      push(@$Config, ["fig", $fig, 1]);      push(@$Config, ["fig", $fig, 1]);
141      push(@$Config, ["bin", $fig_bin, 1]);      push(@$Config, ["bin", $fig_bin, 1]);
142      push(@$Config, ["ext_bin", $env_bin, 1]);      push(@$Config, ["ext_bin", $env_bin, 1]);
# Line 213  Line 214 
214    
215  sub find_in_path  sub find_in_path
216  {  {
217      my($file) = @_;      my($file, @extra) = @_;
218      my(@path) = split(":", $ENV{PATH});      my(@path) = split(":", $ENV{PATH});
219    
220      for my $p (@path)      for my $p (@path, @extra)
221      {      {
222          my $x = "$p/$file";          my $x = "$p/$file";
223          if (-x $x)          if (-x $x)
# Line 240  Line 241 
241    
242      if ($ENV{FIGCONFIG_ENV} eq "mac")      if ($ENV{FIGCONFIG_ENV} eq "mac")
243      {      {
244          if ($python = find_in_path("pythonw"))          #
245            # We'd like to use the MacPython that is installed
246            # as pythonw.
247            #
248            if ($python = find_in_path("pythonw", "/usr/local/bin"))
249          {          {
250                $OtherConfig->{python_require_poundbang_env} = 1;
251              return $python;              return $python;
252          }          }
253    
254          #          #
255          # Didn't find it in the path; we require the          # Otherwise, we can live with the regular python.
256          # MacPython build, and that installs into          # Fall thru to the generic case.
         # /usr/local/bin/pythonw by default.  
257          #          #
   
         return "/usr/local/bin/pythonw";  
258      }      }
     else  
     {  
259          #          #
260          # Non-mac, just look in the env dir or the path.          # Non-mac, just look in the env dir or the path.
261          #          #
# Line 267  Line 268 
268    
269          return find_in_path("python");          return find_in_path("python");
270      }      }
 }  
271    
272  #  #
273  # Find the name of the perl executable we are to use.  # Find the name of the perl executable we are to use.
# Line 423  Line 423 
423    
424  }  }
425    
426    sub finalize_server_scripts
427    {
428        #
429        # After any environment-specific stuff, call start_services and stop_services.
430        #
431    
432        open(F, ">>$start_servers") or die "Cannot write $start_servers: $!";
433        print F "\n$fig_bin/start_services\n";
434        close(F);
435        chmod(0775, $start_servers);
436    
437        open(F, ">>$stop_servers") or die "Cannot write $stop_servers: $!";
438        print F "\n$fig_bin/stop_services\n";
439        close(F);
440        chmod(0775, $stop_servers);
441    
442    }
443    
444  sub write_config_pm  sub write_config_pm
445  {  {
446      my($fh, $config) = @_;      my($fh, $config) = @_;
# Line 515  Line 533 
533    
534      my $python = find_python();      my $python = find_python();
535    
536        if ($OtherConfig->{python_require_poundbang_env})
537        {
538            print $fh "#!/usr/bin/env $python\n";
539        }
540        else
541        {
542      print $fh "#!$python\n";      print $fh "#!$python\n";
543        }
544      print $fh "\n";      print $fh "\n";
545    
546      print $fh "import sys\n";      print $fh "import sys\n";
# Line 548  Line 573 
573  configure_python();  configure_python();
574  configure_environment_specific();  configure_environment_specific();
575    
576    finalize_server_scripts();
577    
578  #  #
579  # Write the shell startup to the figdisk.  # Write the shell startup to the figdisk.
580  #  #

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3