[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.21, Mon Mar 7 17:23:31 2005 UTC
# Line 131  Line 131 
131    
132      my $fig = "$fig_disk/FIG";      my $fig = "$fig_disk/FIG";
133      my $data = "$fig/Data";      my $data = "$fig/Data";
134        my $sproutData = "$fig/SproutData";
135    
136      my $hostname = `hostname`;      my $hostname = `hostname`;
137      chomp $hostname;      chomp $hostname;
# Line 140  Line 141 
141      push(@$Config, ["fig", $fig, 1]);      push(@$Config, ["fig", $fig, 1]);
142      push(@$Config, ["bin", $fig_bin, 1]);      push(@$Config, ["bin", $fig_bin, 1]);
143      push(@$Config, ["ext_bin", $env_bin, 1]);      push(@$Config, ["ext_bin", $env_bin, 1]);
144        push(@$Config, ["common_runtime", $env_dir, 1]);
145        push(@$Config, ["arch", $ENV{FIGCONFIG_ENV}, 1]);
146      push(@$Config, ["data", $data, 1]);      push(@$Config, ["data", $data, 1]);
147      push(@$Config, ["global", "$data/Global", 1]);      push(@$Config, ["global", "$data/Global", 1]);
148      push(@$Config, ["organisms", "$data/Organisms", 1]);      push(@$Config, ["organisms", "$data/Organisms", 1]);
149      push(@$Config, ["RC", "$fig_disk/FIG/ResolutionCenter", 1]);      push(@$Config, ["RC", "$fig_disk/FIG/ResolutionCenter", 1]);
150      push(@$Config, ["NR", "$fig_disk/FIG/NR", 1]);      push(@$Config, ["NR", "$fig_disk/FIG/NR", 1]);
151      push(@$Config, ["temp", "$fig_disk/FIG/Tmp", 1]);      push(@$Config, ["temp", "$fig_disk/FIG/Tmp", 1]);
152      push(@$Config, ["temp_url", "http://$hostname/FIG-Tmp", 1]);      push(@$Config, ["sproutData", $sproutData, 1]);
153      push(@$Config, ["cgi_url", "http://$hostname/FIG", 1]);  
154        my $sandbox;
155        if ($ENV{FIGCONFIG_SANDBOX})
156        {
157            $sandbox = "/$ENV{FIGCONFIG_SANDBOX}";
158        }
159    
160        push(@$Config, ["temp_url", "http://$hostname$sandbox/FIG-Tmp", 1]);
161        push(@$Config, ["cgi_url", "http://$hostname$sandbox/FIG", 1]);
162    
163      #      #
164      # 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 166 
166      # sense to derive the above 2 values from these.  -- GJO      # sense to derive the above 2 values from these.  -- GJO
167      #      #
168    
169      push(@$Config, ["temp_base", "/FIG-Tmp/", 1]);      push(@$Config, ["temp_base", "$sandbox/FIG-Tmp/", 1]);
170      push(@$Config, ["cgi_base", "/FIG/", 1]);      push(@$Config, ["cgi_base", "$sandbox/FIG/", 1]);
171  }  }
172    
173  sub compute_environment  sub compute_environment
# Line 188  Line 199 
199      push(@$Env, ["PATH", join(":", @path), 1]);      push(@$Env, ["PATH", join(":", @path), 1]);
200    
201      push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}", 1]);      push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}", 1]);
202    
203        my @perllib = grep({ $_ ne "." } @INC, "$fig_disk/config", $release_lib,
204                          "$release_lib/FigKernelPackages");
205    
206        push(@$Env, ["PERL5LIB", join(":", @perllib), 1]);
207  }  }
208    
209  sub configure_python  sub configure_python
# Line 247  Line 263 
263      #      #
264      # Special case for the mac.      # Special case for the mac.
265      #      #
266        # RDO 20040603 - don't do this any more; we want to pick up
267        # the python we ship.
268        #
269    
270      if ($ENV{FIGCONFIG_ENV} eq "mac")      if (0 && $ENV{FIGCONFIG_ENV} eq "mac")
271      {      {
272          #          #
273          # We'd like to use the MacPython that is installed          # We'd like to use the MacPython that is installed
# Line 272  Line 291 
291      $python = "$ENV{FIGCONFIG_ENV_DIR}/bin/python";      $python = "$ENV{FIGCONFIG_ENV_DIR}/bin/python";
292      if (-x $python)      if (-x $python)
293      {      {
294            #
295            # The mac doesn't seem to like the long #! lines, so we'll use poundbang env.
296            #
297            if ($ENV{FIGCONFIG_ENV} =~ /^mac/)
298            {
299                $OtherConfig->{python_require_poundbang_env} = 1;
300            }
301          return $python;          return $python;
302      }      }
303    
# Line 324  Line 350 
350              print $fh "export $name\n";              print $fh "export $name\n";
351          }          }
352      }      }
353        print $fh "alias rtpath='source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.sh'\n";
354  }  }
355    
356  sub write_csh_init  sub write_csh_init
# Line 354  Line 381 
381          }          }
382      }      }
383    
384        #
385        # Alias for RT stuff.
386        #
387        print $fh "alias rtpath 'source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.csh'\n";
388  }  }
389    
390  sub run_script  sub run_script
# Line 534  Line 565 
565    
566      print $fh "use FIG_Config;\n";      print $fh "use FIG_Config;\n";
567      print $fh "\n";      print $fh "\n";
568        print $fh "#### END tool_hdr ####\n\n"
569  }  }
570    
571  sub write_tool_hdr_python  sub write_tool_hdr_python
# Line 552  Line 584 
584      }      }
585      print $fh "\n";      print $fh "\n";
586    
587      print $fh "import sys\n";      print $fh "import sys, os\n";
588    
589    
590      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";      print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";
591    
592        #
593        # Append the perl path to the environment, for use later with CallPerl.
594        #
595    
596        my $perlpath = join(":", @INC, "$fig_disk/config", $release_lib, "$release_lib/FigKernelPackages");
597        print $fh <<END;
598    if os.getenv("PERL5LIB", "") != "":
599        _delim = ":"
600    else:
601        _delim = ""
602    os.environ["PERL5LIB"] = "$perlpath" + _delim + os.getenv("PERL5LIB", "")
603    
604    END
605    
606      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";
607      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";
608      print $fh "#BEGIN switch_to_release generated code\n";      print $fh "#BEGIN switch_to_release generated code\n";
# Line 567  Line 613 
613    
614      print $fh "import FIG_Config\n";      print $fh "import FIG_Config\n";
615      print $fh "\n";      print $fh "\n";
616        print $fh "#### END tool_hdr_py ####\n\n"
617  }  }
618    
619  setup_directories("$fig_disk/bin",  setup_directories("$fig_disk/bin",
# Line 581  Line 628 
628  configure_std_fig_environment();  configure_std_fig_environment();
629  configure_python();  configure_python();
630  configure_environment_specific();  configure_environment_specific();
631    # configure_database();
632    
633  finalize_server_scripts();  finalize_server_scripts();
634    
# Line 623  Line 671 
671    
672  require FigCommon::SwitchRelease;  require FigCommon::SwitchRelease;
673    
674    #
675    # We need to tweak the current path and PERL5LIB environment to get bootstrapping to
676    # work correctly.
677    #
678    
679    $ENV{PATH} = "$ENV{FIGCONFIG_ENVDIR}/bin:$ENV{PATH}";
680    
681    $ENV{PERL5LIB} = (map { $_->[1] } grep { $_->[0] eq "PERL5LIB"} @$Env)[0];
682    
683  &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.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3