ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/Installation/scramwrapper
Revision: 1.14
Committed: Mon Apr 29 16:09:23 2002 UTC (23 years ago) by sashby
Branch: MAIN
CVS Tags: V0_19_6, V0_19_6p1, V0_19_5, SFATEST, V0_19_4, V0_19_4_pre3, V0_19_4_pre2
Branch point for: V0_19_4_B
Changes since 1.13: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #!__perlexe__
2 ###############################################################
3 # scram #
4 ###############################################################
5 # modified : Mon Nov 12 11:17:18 2001 / SFA #
6 # function : Wrap the main scram program, set up any system #
7 # : variables required and process arguments. #
8 # : #
9 # : #
10 ###############################################################
11
12 # Set the environment variable SCRAM here to avoid using "which":
13 $ENV{'SCRAM'}=$0;
14
15 $re='false';
16 my $ret;
17 @args=@ARGV;
18
19 for ( my $i=0; $i<=$#args; $i++ )
20 {
21 if ( $args[$i] eq "-re" )
22 {
23 # Always request a User Return to exit the program
24 $re="true";
25 # cut it out of argument list passed down
26 splice(@args,$i,1);
27 }
28 }
29
30 # Set the SCRAM_HOME environment variable to point
31 # to current version:
32 if ( $ENV{SCRAM_HOME} eq "" )
33 {
34 $ENV{SCRAM_HOME}="__basedir__";
35 }
36
37 # The perl executable is now found using env
38 # instead of being hard-coded (NOTE: this var is only
39 # used in $ENV{SCRAM_HOME}/src/basics.mk):
40 if ( $ENV{SCRAMPERL} eq "" )
41 {
42 $ENV{SCRAMPERL}="__perlexe__"; # This should be changed if a hard-coded path
43 # to Perl5 is required in the buildsystem
44 }
45
46 # Set the path to local modules:
47 $ENV{PERL5LIB}=join(":", "$ENV{SCRAM_HOME}/src", split(":", $ENV{PERL5LIB}));
48
49 # Set shell variables to control scram behaviour:
50 $ENV{'SITENAME'}='__scramsite__' if ( ! $ENV{'SITENAME'});
51 # This variable overrides the reading of project areas
52 # for tool settings during scram setup/scram project:
53 $ENV{'SEARCHOVRD'}='true' if ( ! $ENV{'SEARCHOVRD'});
54 # Default location for cmstools file:
55 $ENV{'LOCCMSTOOLS'}='__loccmstools__' if ( ! $ENV{'LOCCMSTOOLS'});
56
57 # Execute scramcli with args:
58 if ( -e "$ENV{SCRAM_HOME}/src/scramcli" )
59 {
60 exec { "/usr/bin/env" } "/usr/bin/env", "perl", "$ENV{SCRAM_HOME}/src/scramcli", @args;
61 die "Problems executing scram: $!","\n";
62 }
63 else
64 # For older versions:
65 {
66 exec { "/usr/bin/env" } "/usr/bin/env", "perl", "$ENV{SCRAM_HOME}/src/scram", @args;
67 die "Problems executing scram: $!","\n";
68 }
69
70 # Prompt for a carriage return if
71 # the -re option was set:
72 if ( $re eq 'true' )
73 {
74 print "\nPress RETURN to exit\n";
75 $junk=<STDIN>;
76 }
77
78 # Return an exit status:
79 exit $ret/256;