[Bio] / FigCommon / bootstrap.pl Repository:
ViewVC logotype

Annotation of /FigCommon/bootstrap.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.22 - (view) (download) (as text)

1 : olson 1.1 #
2 :     # FIG bootstrap script.
3 :     #
4 :     # Control is passed here from the toplevel configure (or dists/releases/install depending
5 :     # on how far we've gotten in the process).
6 :     #
7 :     # The configure has set the following environment variables for our use:
8 :     #
9 :     # FIG_HOME Root of the FIGdisk tree we're setting up
10 :     # FIGCONFIG_ENV Name of the environment we're configuring for
11 :     # FIGCONFIG_ENV_DIR Directory in which the binary install tree for $FIGCONFIG_ENV lives
12 :     # FIGCONFIG_RELEASE Release number we're configuring
13 :     # FIGCONFIG_RELEASE_DIR Directory in which that release lives
14 :     #
15 :     # Important note: perl system libraries may not be available when this
16 :     # script is running, if the FIGCONFIG_ENV_DIR is different than it was
17 :     # when the binaries were created. Part of the task of this
18 :     # script is to recognize this case and configure the process
19 :     # environment correctly so that the post-install process as
20 :     # handled by the Makefiles can use perl properly, without concern for paths.
21 :     #
22 :    
23 :     #
24 :     # Look into the FIGCONFIG_ENV_DIR for the PREFIX that this
25 :     # environment was compiled on. If that directory is different
26 :     # than the one we're currently using, rewrite @INC accordingly.
27 :     #
28 :     # We put this into a BEGIN block so that we can later use "use"
29 :     # without worrying about paths.
30 :     #
31 :     # We also set the $perlenv_override to true if we've done this,
32 :     # so we can insert these fixes into the perl tool header.
33 :     #
34 :    
35 :     BEGIN {
36 :    
37 : olson 1.3 print "Here in the perl bootstrap. inc is:\n" . join("\n", @INC), "\n";
38 : olson 1.1
39 :     my $my_prefix, $prefix, $inc, @newInc;
40 :    
41 :     $my_prefix = $ENV{FIGCONFIG_ENV_DIR};
42 :     open(P, "<$my_prefix/PREFIX");
43 :     $prefix = <P>;
44 :     chomp $prefix;
45 :    
46 :    
47 :     # print "Prefix is $prefix myprefix=$my_prefix\n";
48 :    
49 :     if ($prefix ne $my_prefix)
50 :     {
51 :     @newInc = ();
52 :     for $inc (@INC)
53 :     {
54 :     $inc =~ s,^$prefix,$my_prefix,;
55 :     push(@newInc, $inc);
56 :     }
57 :    
58 :     $::perlenv_override = 1;
59 : olson 1.3 @INC = @newInc;
60 : olson 1.1 }
61 :     }
62 :    
63 :    
64 :     use FileHandle;
65 :     use strict;
66 :    
67 :     #
68 :     # Environment definition
69 :     #
70 :     # This list contains triples
71 :     # ($name, $value, $appendFlag). $name is the name of the
72 :     # variable; $value is the value to set, and $appendFlag
73 :     # is nonzero if we need to append this value to an existing
74 :     # environment variable.
75 :     #
76 :    
77 :     our $Env = [];
78 :    
79 :     #
80 :     # FIG configuration information.
81 :     # This list contains tuples [$name, $value, $quote]
82 :     # which are to be set in the FIG_Config modules for
83 :     # both python and perl. $quote is 1 for things that need
84 :     # to be quoted, 0 otherwise.
85 :     #
86 :     our $Config = [];
87 :    
88 :     #
89 :     # Other key/value pairs of stuff we may need to pass
90 :     # to and from the environment-specific configuration modules.
91 :     #
92 :     # Known keys:
93 :     #
94 :     # pythonpath
95 :     #
96 :    
97 :     our $OtherConfig = {};
98 :    
99 :     #
100 :     # Cache values of the various places we may be installing things.
101 :     #
102 :    
103 :     our $fig_disk = $ENV{FIG_HOME};
104 :     our $env_name = $ENV{FIGCONFIG_ENV};
105 : olson 1.7 our $env_dir = "$ENV{FIGCONFIG_ENV_DIR}";
106 : olson 1.1 our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";
107 :     our $env_lib = "$ENV{FIGCONFIG_ENV_DIR}/lib";
108 : olson 1.2 #
109 :     # We are moving to use a symlink in dist/releases/current for these.
110 :     # This symlink is managed by switch_to_release.
111 :     #
112 :     #our $release_bin = "$ENV{FIGCONFIG_RELEASE_DIR}/bin/$ENV{FIGCONFIG_ENV}";
113 :     #our $release_lib = "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}";
114 :    
115 : olson 1.8 our $release_bin = "$fig_disk/dist/releases/current/$ENV{FIGCONFIG_ENV}/bin";
116 :     our $release_lib = "$fig_disk/dist/releases/current/$ENV{FIGCONFIG_ENV}/lib";
117 : olson 1.2
118 :     our $fig_bin = "$fig_disk/FIG/bin";
119 : olson 1.1
120 :     #
121 :     # Location of start/stop servers scripts.
122 :     #
123 :     our $start_servers = "$fig_disk/bin/start-servers";
124 :     our $stop_servers = "$fig_disk/bin/stop-servers";
125 :    
126 :     sub configure_std_fig_environment
127 :     {
128 :     #
129 :     # Populate the Config with the usual stuff we need in FIG_Config.pm.
130 :     #
131 :    
132 :     my $fig = "$fig_disk/FIG";
133 :     my $data = "$fig/Data";
134 : olson 1.21 my $sproutData = "$fig/SproutData";
135 : olson 1.1
136 :     my $hostname = `hostname`;
137 :     chomp $hostname;
138 :    
139 :     push(@$Config, ["fig_disk", $fig_disk, 1]);
140 : olson 1.6 push(@$Config, ["blastmat", "$fig_disk/BLASTMAT", 1]);
141 : olson 1.1 push(@$Config, ["fig", $fig, 1]);
142 : olson 1.2 push(@$Config, ["bin", $fig_bin, 1]);
143 : olson 1.1 push(@$Config, ["ext_bin", $env_bin, 1]);
144 : olson 1.18 push(@$Config, ["common_runtime", $env_dir, 1]);
145 :     push(@$Config, ["arch", $ENV{FIGCONFIG_ENV}, 1]);
146 : olson 1.22 push(@$Config, ["var", "$fig/var", 1]);
147 : olson 1.1 push(@$Config, ["data", $data, 1]);
148 :     push(@$Config, ["global", "$data/Global", 1]);
149 :     push(@$Config, ["organisms", "$data/Organisms", 1]);
150 :     push(@$Config, ["RC", "$fig_disk/FIG/ResolutionCenter", 1]);
151 :     push(@$Config, ["NR", "$fig_disk/FIG/NR", 1]);
152 :     push(@$Config, ["temp", "$fig_disk/FIG/Tmp", 1]);
153 : olson 1.21 push(@$Config, ["sproutData", $sproutData, 1]);
154 : olson 1.11
155 :     my $sandbox;
156 :     if ($ENV{FIGCONFIG_SANDBOX})
157 :     {
158 :     $sandbox = "/$ENV{FIGCONFIG_SANDBOX}";
159 :     }
160 :    
161 :     push(@$Config, ["temp_url", "http://$hostname$sandbox/FIG-Tmp", 1]);
162 :     push(@$Config, ["cgi_url", "http://$hostname$sandbox/FIG", 1]);
163 : golsen 1.9
164 :     #
165 :     # Add values for a relative base href of temp and CGI pages. The latter
166 :     # is used by HHTP.pm to write common page start. It would make the most
167 :     # sense to derive the above 2 values from these. -- GJO
168 :     #
169 :    
170 : olson 1.11 push(@$Config, ["temp_base", "$sandbox/FIG-Tmp/", 1]);
171 :     push(@$Config, ["cgi_base", "$sandbox/FIG/", 1]);
172 : olson 1.1 }
173 :    
174 :     sub compute_environment
175 :     {
176 :     #
177 :     # ReleaseTools configuration.
178 :     #
179 :    
180 :     push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);
181 :     push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);
182 :     push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);
183 : olson 1.2 push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);
184 : olson 1.1 push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);
185 :    
186 :     push(@$Env, ["BLASTMAT", "$ENV{FIG_HOME}/BLASTMAT", 0]);
187 :    
188 :     #
189 :     # Determine the path to use.
190 :     #
191 :     # This includes the path into the particular release we're configuring for,
192 :     # and to the environment's bin directory.
193 :     #
194 :    
195 :     my @path = ();
196 :     push(@path, $env_bin);
197 : olson 1.2 push(@path, $fig_bin);
198 : olson 1.1 push(@path, "$fig_disk/bin");
199 :    
200 :     push(@$Env, ["PATH", join(":", @path), 1]);
201 :    
202 : olson 1.2 push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}", 1]);
203 : olson 1.11
204 : olson 1.14 my @perllib = grep({ $_ ne "." } @INC, "$fig_disk/config", $release_lib,
205 :     "$release_lib/FigKernelPackages");
206 : olson 1.12
207 :     push(@$Env, ["PERL5LIB", join(":", @perllib), 1]);
208 : olson 1.1 }
209 :    
210 :     sub configure_python
211 :     {
212 :     #
213 :     # Determine the PYTHONPATH we're to use.
214 :     #
215 :     # Right now, we don't compute a replacement for the system path,
216 :     # but we're likely going to require that *if* python is
217 :     # distributed with the environment. We're currently not doing that.
218 :     #
219 :     # So we just need to point to any python packages in the release,
220 :     # and to packages that were installed in the environment dir.
221 :     #
222 :    
223 :     my $python = find_python();
224 :     print "Found python at $python\n";
225 :    
226 :     my $py_version = `$python -c 'import sys; print "%d.%d" % (sys.version_info[:2])'`;
227 :     chomp $py_version;
228 :     print "Python version $py_version\n";
229 :    
230 : olson 1.2 $OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";
231 :    
232 : olson 1.1 my @path = ();
233 : olson 1.2 push(@path, $OtherConfig->{python_site_path});
234 :     push(@path, "$release_lib");
235 : olson 1.1 push(@path, "$fig_disk/config");
236 :     push(@$Env, ["PYTHONPATH", join(":", @path), 1]);
237 :    
238 :     $OtherConfig->{pythonpath} = join(":", @path);
239 :     }
240 :    
241 :     sub find_in_path
242 :     {
243 : olson 1.5 my($file, @extra) = @_;
244 : olson 1.1 my(@path) = split(":", $ENV{PATH});
245 :    
246 : olson 1.5 for my $p (@path, @extra)
247 : olson 1.1 {
248 :     my $x = "$p/$file";
249 :     if (-x $x)
250 :     {
251 :     return $x;
252 :     }
253 :     }
254 :     return undef;
255 :     }
256 :    
257 :     #
258 :     # Find the name of the python executable we are to use.
259 :     #
260 :     sub find_python
261 :     {
262 :     my $python;
263 :    
264 :     #
265 :     # Special case for the mac.
266 :     #
267 : olson 1.11 # RDO 20040603 - don't do this any more; we want to pick up
268 :     # the python we ship.
269 :     #
270 : olson 1.1
271 : olson 1.11 if (0 && $ENV{FIGCONFIG_ENV} eq "mac")
272 : olson 1.1 {
273 : olson 1.7 #
274 :     # We'd like to use the MacPython that is installed
275 :     # as pythonw.
276 :     #
277 :     if ($python = find_in_path("pythonw", "/usr/local/bin"))
278 : olson 1.1 {
279 : olson 1.7 $OtherConfig->{python_require_poundbang_env} = 1;
280 : olson 1.1 return $python;
281 :     }
282 :    
283 :     #
284 : olson 1.7 # Otherwise, we can live with the regular python.
285 :     # Fall thru to the generic case.
286 : olson 1.1 #
287 : olson 1.7 }
288 :     #
289 :     # Non-mac, just look in the env dir or the path.
290 :     #
291 : olson 1.1
292 : olson 1.7 $python = "$ENV{FIGCONFIG_ENV_DIR}/bin/python";
293 :     if (-x $python)
294 :     {
295 : olson 1.13 #
296 :     # The mac doesn't seem to like the long #! lines, so we'll use poundbang env.
297 :     #
298 : olson 1.15 if ($ENV{FIGCONFIG_ENV} =~ /^mac/)
299 : olson 1.13 {
300 :     $OtherConfig->{python_require_poundbang_env} = 1;
301 :     }
302 : olson 1.7 return $python;
303 : olson 1.1 }
304 :    
305 : olson 1.7 return find_in_path("python");
306 : olson 1.1 }
307 :    
308 :     #
309 :     # Find the name of the perl executable we are to use.
310 :     #
311 :     sub find_perl
312 :     {
313 :     my $perl;
314 :    
315 :     $perl = "$ENV{FIGCONFIG_ENV_DIR}/bin/perl";
316 :     if (-x $perl)
317 :     {
318 :     return $perl;
319 :     }
320 :    
321 :     warn "We did not find a perl executable in the SEED distribution; some modules may not be found\n";
322 :     return find_in_path("perl");
323 :     }
324 :    
325 :     sub write_bash_init
326 :     {
327 :     my($fh, $env) = @_;
328 :    
329 :     foreach my $item (@$env)
330 :     {
331 :     my($name, $value, $append) = @$item;
332 :    
333 :     if ($append)
334 :     {
335 :     #
336 :     # Write code to detect if the value is set, and act accordingly.
337 :     #
338 :    
339 :     print $fh <<END;
340 :     DELIM=
341 :     if [ -n "\$$name" ] ; then
342 :     DELIM=:
343 :     fi
344 : olson 1.10 $name=$value\${DELIM}\${$name}
345 : olson 1.1 export $name
346 :     END
347 :     }
348 :     else
349 :     {
350 :     print $fh "$name=\"$value\"\n";
351 :     print $fh "export $name\n";
352 :     }
353 :     }
354 : olson 1.20 print $fh "alias rtpath='source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.sh'\n";
355 : olson 1.1 }
356 :    
357 :     sub write_csh_init
358 :     {
359 :     my($fh, $env) = @_;
360 :    
361 :     foreach my $item (@$env)
362 :     {
363 :     my($name, $value, $append) = @$item;
364 :    
365 :     if ($append)
366 :     {
367 :     #
368 :     # Write code to detect if the value is set, and act accordingly.
369 :     #
370 :    
371 :     print $fh <<END;
372 :     if (\$?$name) then
373 : olson 1.10 setenv $name $value:\${$name}
374 : olson 1.1 else
375 :     setenv $name $value
376 :     endif
377 :     END
378 :     }
379 :     else
380 :     {
381 :     print $fh "setenv $name \"$value\"\n";
382 :     }
383 :     }
384 :    
385 : olson 1.20 #
386 :     # Alias for RT stuff.
387 :     #
388 :     print $fh "alias rtpath 'source \$RTDIST/releases/\$RTCURRENT/ReleaseTools/RTPath.csh'\n";
389 : olson 1.1 }
390 :    
391 :     sub run_script
392 :     {
393 :     my($script) = @_;
394 :    
395 :    
396 :     unless (my $ret = do $script)
397 :     {
398 :     if ($@)
399 :     {
400 :     warn "Error parsing $script: $@\n";
401 :     }
402 :     elsif (!defined($ret))
403 :     {
404 :     warn "Couldn't do $script: $!\n";
405 :     }
406 :     else
407 :     {
408 :     warn "Counldn't run $script\n";
409 :     }
410 :     }
411 :    
412 :    
413 :     }
414 :    
415 :     sub configure_environment_specific
416 :     {
417 :     my $env_script = $ENV{FIGCONFIG_ENV_CONFIG};
418 :    
419 :     if (! -f $env_script)
420 :     {
421 :     warn "No environment-specific configuration file $env_script found, skipping\n";
422 :     return;
423 :     }
424 :    
425 :     run_script($env_script);
426 :     }
427 :    
428 :     #
429 :     # Create any directories that might be missing.
430 :     #
431 :    
432 :     sub setup_directories
433 :     {
434 :     my(@needed) = @_;
435 :    
436 :     for my $dir (@needed)
437 :     {
438 :     if (! -d $dir)
439 :     {
440 :     mkdir($dir) or warn "Could not create $dir: $!\n";
441 :     }
442 :     }
443 :     }
444 :    
445 :     sub setup_server_scripts
446 :     {
447 :     #
448 :     # Remove any start/stop servers scripts we might have, and write the stub
449 :     # start.
450 :     #
451 :    
452 :     unlink($start_servers);
453 :     unlink($stop_servers);
454 :    
455 :     open(F, ">$start_servers") or die "Cannot write $start_servers: $!";
456 :     print F "#!/bin/sh\n\n";
457 :     close(F);
458 :     chmod(0775, $start_servers);
459 :    
460 :     open(F, ">$stop_servers") or die "Cannot write $stop_servers: $!";
461 :     print F "#!/bin/sh\n\n";
462 :     close(F);
463 :     chmod(0775, $stop_servers);
464 :    
465 :     }
466 :    
467 : olson 1.7 sub finalize_server_scripts
468 :     {
469 :     #
470 :     # After any environment-specific stuff, call start_services and stop_services.
471 :     #
472 :    
473 :     open(F, ">>$start_servers") or die "Cannot write $start_servers: $!";
474 :     print F "\n$fig_bin/start_services\n";
475 :     close(F);
476 :     chmod(0775, $start_servers);
477 :    
478 :     open(F, ">>$stop_servers") or die "Cannot write $stop_servers: $!";
479 :     print F "\n$fig_bin/stop_services\n";
480 :     close(F);
481 :     chmod(0775, $stop_servers);
482 :    
483 :     }
484 :    
485 : olson 1.1 sub write_config_pm
486 :     {
487 :     my($fh, $config) = @_;
488 :    
489 :     print $fh "package FIG_Config;\n\n";
490 :    
491 :     foreach my $item (@$config)
492 :     {
493 :     my($name, $value, $quote) = @$item;
494 :    
495 :     my $q = $quote ? '"' : '';
496 :     printf $fh "\$%-15s = $q$value$q;\n", $name
497 :     }
498 :    
499 :     print $fh "\n1;\n";
500 :     }
501 :    
502 :     sub write_config_py
503 :     {
504 :     my($fh, $config) = @_;
505 :    
506 :     foreach my $item (@$config)
507 :     {
508 :     my($name, $value, $quote) = @$item;
509 :    
510 :     #
511 :     # Ugh. "global" is a keyword in python.
512 :     #
513 :    
514 :     $name = "global_dir" if $name eq "global";
515 :    
516 :     my $q = $quote ? '"' : '';
517 :     printf $fh "%-15s = $q$value$q\n", $name
518 :     }
519 :     }
520 :    
521 :     sub write_tool_hdr_perl
522 :     {
523 :     my($fh) = @_;
524 :    
525 :     my $perl = find_perl();
526 :    
527 :     print $fh "#!$perl\n";
528 :     print $fh "\n";
529 :    
530 :     if ($::perlenv_override)
531 :     {
532 :     #
533 :     # Write the tool header BEGIN block to reset the environment.
534 :     #
535 :    
536 :     print $fh "BEGIN {\n";
537 :     print $fh " \@INC = qw(\n";
538 :     for my $inc (@INC)
539 :     {
540 :     next if $inc eq '.';
541 :     print $fh "\t$inc\n";
542 :     }
543 : olson 1.2 print $fh ");\n";
544 : olson 1.1 print $fh "}\n";
545 :     }
546 :    
547 :     print $fh "use Data::Dumper;\n";
548 :     print $fh "use Carp;\n";
549 :    
550 : olson 1.2 #
551 :     # We generate a comment here that gets expanded by switch_to_release
552 :     # This is part of the effort in making the environment bootstrapping
553 :     # code independent of releases.
554 :     #
555 :    
556 :     #print $fh "use lib \"$release_lib\";\n";
557 :     #print $fh "use lib \"$release_lib/FigKernelPackages\";\n";
558 :    
559 :     print $fh "# Following block is expanded by switch_to_release to add use lib directives\n";
560 :     print $fh "# to point at the correct locations in the release directory.\n";
561 :     print $fh "#BEGIN switch_to_release generated code\n";
562 :     print $fh "#END switch_to_release generated code\n";
563 :     print $fh "\n";
564 :    
565 : olson 1.1 print $fh "use lib \"$fig_disk/config\";\n";
566 :    
567 :     print $fh "use FIG_Config;\n";
568 :     print $fh "\n";
569 : olson 1.11 print $fh "#### END tool_hdr ####\n\n"
570 : olson 1.1 }
571 :    
572 :     sub write_tool_hdr_python
573 :     {
574 :     my($fh) = @_;
575 :    
576 :     my $python = find_python();
577 :    
578 : olson 1.4 if ($OtherConfig->{python_require_poundbang_env})
579 :     {
580 :     print $fh "#!/usr/bin/env $python\n";
581 :     }
582 :     else
583 :     {
584 :     print $fh "#!$python\n";
585 :     }
586 : olson 1.1 print $fh "\n";
587 :    
588 : olson 1.11 print $fh "import sys, os\n";
589 : olson 1.2
590 :    
591 :     print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";
592 :    
593 : olson 1.11 #
594 :     # Append the perl path to the environment, for use later with CallPerl.
595 :     #
596 :    
597 : olson 1.14 my $perlpath = join(":", @INC, "$fig_disk/config", $release_lib, "$release_lib/FigKernelPackages");
598 : olson 1.11 print $fh <<END;
599 :     if os.getenv("PERL5LIB", "") != "":
600 :     _delim = ":"
601 :     else:
602 :     _delim = ""
603 :     os.environ["PERL5LIB"] = "$perlpath" + _delim + os.getenv("PERL5LIB", "")
604 :    
605 :     END
606 :    
607 : olson 1.2 print $fh "# Following block is expanded by switch_to_release to add use lib directives\n";
608 :     print $fh "# to point at the correct locations in the release directory.\n";
609 :     print $fh "#BEGIN switch_to_release generated code\n";
610 :     print $fh "#END switch_to_release generated code\n";
611 :     print $fh "\n";
612 :    
613 :     print $fh "sys.path.append('$fig_disk/config')\n";
614 :    
615 : olson 1.1 print $fh "import FIG_Config\n";
616 :     print $fh "\n";
617 : olson 1.11 print $fh "#### END tool_hdr_py ####\n\n"
618 : olson 1.1 }
619 :    
620 :     setup_directories("$fig_disk/bin",
621 :     "$fig_disk/config");
622 :    
623 :     setup_server_scripts();
624 :    
625 :    
626 :     find_python();
627 :    
628 :     compute_environment();
629 :     configure_std_fig_environment();
630 :     configure_python();
631 :     configure_environment_specific();
632 : olson 1.19 # configure_database();
633 : olson 1.7
634 :     finalize_server_scripts();
635 : olson 1.1
636 :     #
637 :     # Write the shell startup to the figdisk.
638 :     #
639 :     open(FH, ">$fig_disk/config/fig-user-env.sh") or die "Cannot write $fig_disk/config/fig-user-env.sh: $!";
640 :     write_bash_init(\*FH, $Env);
641 :     close(FH);
642 :    
643 :     open(FH, ">$fig_disk/config/fig-user-env.csh") or die "Cannot write $fig_disk/config/fig-user-env.csh: $!";
644 :     write_csh_init(\*FH, $Env);
645 :     close(FH);
646 :    
647 :     #
648 :     # Write the FIG_Config file.
649 :     #
650 :    
651 :     open(FH, ">$fig_disk/config/FIG_Config.pm") or die "Cannot write $fig_disk/config/FIG_Config.pm: $!";
652 :     write_config_pm(\*FH, $Config);
653 :     close(FH);
654 :    
655 :     open(FH, ">$fig_disk/config/FIG_Config.py") or die "Cannot write $fig_disk/config/FIG_Config.py: $!";
656 :     write_config_py(\*FH, $Config);
657 :     close(FH);
658 :    
659 :     #
660 :     # Write the tool headers
661 :     #
662 :    
663 : olson 1.2 open(FH, ">$fig_disk/config/base_tool_hdr") or die "Cannot write $fig_disk/config/tool_hdr: $!";
664 : olson 1.1 write_tool_hdr_perl(\*FH);
665 :     close(FH);
666 :    
667 : olson 1.2 open(FH, ">$fig_disk/config/base_tool_hdr_py") or die "Cannot write $fig_disk/config/tool_hdr_py: $!";
668 : olson 1.1 write_tool_hdr_python(\*FH);
669 :     close(FH);
670 :    
671 : olson 1.2 unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");
672 :    
673 :     require FigCommon::SwitchRelease;
674 : olson 1.1
675 : olson 1.16 #
676 :     # We need to tweak the current path and PERL5LIB environment to get bootstrapping to
677 :     # work correctly.
678 :     #
679 :    
680 :     $ENV{PATH} = "$ENV{FIGCONFIG_ENVDIR}/bin:$ENV{PATH}";
681 :    
682 : olson 1.17 $ENV{PERL5LIB} = (map { $_->[1] } grep { $_->[0] eq "PERL5LIB"} @$Env)[0];
683 : olson 1.16
684 : olson 1.2 &FigCommon::SwitchRelease::switch_to_release($fig_disk, $ENV{FIGCONFIG_ENV}, $ENV{FIGCONFIG_RELEASE});

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3