9 |
|
$normal = "\033[0m"; |
10 |
|
@allowed_commands=qw(project build install version list arch setup); |
11 |
|
|
12 |
< |
foreach $command ( @allowed_commands ) { |
13 |
< |
if ( $inputcmd=~/^$command\Z/i) { |
12 |
> |
if ( $inputcmd ne "" ) { |
13 |
> |
foreach $command ( @allowed_commands ) { |
14 |
> |
if ( $command=~/^$inputcmd/i) { |
15 |
|
# Deal with a help request |
16 |
|
do{ helpheader($command); |
17 |
|
&{"help_".$command}; exit; } if $ARGV[0]=~/help/i; |
18 |
|
&$command; $found='true'; |
19 |
|
last; |
20 |
|
} |
21 |
+ |
} |
22 |
|
} |
23 |
|
|
24 |
|
if ( ! ( $found=~/true/ ) ) { |
46 |
|
sub project { |
47 |
|
# process options |
48 |
|
while ( $ARGV[0]=~"^-" ) { |
49 |
< |
if ( (shift @ARGV)=~/-d/ ) { #installation area directory |
49 |
> |
if ( $ARGV[0]=~/-n/ ) { |
50 |
> |
shift @ARGV; |
51 |
> |
$ENV{devareaname}=shift @ARGV; |
52 |
> |
} |
53 |
> |
if ( $ARGV[0]=~/-d/ ) { #installation area directory |
54 |
> |
shift @ARGV; |
55 |
|
chdir $ARGV[0]; |
56 |
|
shift @ARGV; |
57 |
|
} |
67 |
|
BootStrapProject("$project\?\?$version"); |
68 |
|
# Go setup the rest of the environement, now we can |
69 |
|
chdir $ENV{LOCALTOP}; |
70 |
< |
&localtop; |
70 |
> |
&localtop; |
71 |
|
LoadEnvFile(); |
72 |
|
# |
73 |
|
# Now create the directories specified in the interface |
84 |
|
use clientfile; |
85 |
|
BuildClientFile( $ENV{SCRAM_ProjReqsDoc} ); |
86 |
|
use Cwd; |
87 |
< |
print "Installation Located at:\n".cwd()."\n"; |
87 |
> |
print "\nInstallation Procedure Complete. \n". |
88 |
> |
"Installation Located at:\n".cwd()."\n"; |
89 |
|
} |
90 |
|
|
91 |
|
sub FullEnvInit { |
276 |
|
$ENV{SCRAM_BootStrapFiles}="$ENV{LOCALTOP}/.SCRAM:". |
277 |
|
$ENV{SCRAM_BootStrapFiles}; |
278 |
|
} |
279 |
< |
# Check for the correct toolfile |
280 |
< |
# ideally try and download it if not already in .SCRAM |
281 |
< |
# Only scram toolbox files supported so far |
282 |
< |
if ( ! -e "$ENV{LOCALTOP}/.SCRAM/$toolname" ) { |
279 |
> |
# If no toolname specified then its a full setup |
280 |
> |
if ( $toolname eq "" ) { |
281 |
> |
my $filebase="$ENV{LOCALTOP}/.SCRAM/$ENV{SCRAM_ARCH}"; |
282 |
> |
rename "$filebase/clientsettings", "$filebase/clientsettings.old"; |
283 |
> |
rename "$filebase/clientsettings_reqs", |
284 |
> |
"$filebase/clientsettings_reqs.old"; |
285 |
> |
use clientfile; |
286 |
> |
BuildClientFile( $ENV{SCRAM_ProjReqsDoc} ); |
287 |
> |
} |
288 |
> |
else { |
289 |
> |
# Check for the correct toolfile |
290 |
> |
# ideally try and download it if not already in .SCRAM |
291 |
> |
# Only scram toolbox files supported so far |
292 |
> |
if ( ! -e "$ENV{LOCALTOP}/.SCRAM/$toolname" ) { |
293 |
|
&urlhandler::urlhandler("file:$ENV{SCRAM_HOME}/toolbox/" |
294 |
|
.$toolname, "$ENV{LOCALTOP}/.SCRAM/$toolname") ; |
295 |
+ |
} |
296 |
+ |
# Parse the toolfile and update the clientsettings file |
297 |
+ |
# currently just append to the end |
298 |
+ |
use clientfile; |
299 |
+ |
clientfile::openclientfile('add'); |
300 |
+ |
clientfile::_tool("file:$toolname"); |
301 |
+ |
closeclientfile; |
302 |
|
} |
278 |
– |
# Parse the toolfile and update the clientsettings file |
279 |
– |
# currently just append to the end |
280 |
– |
use clientfile; |
281 |
– |
clientfile::openclientfile('add'); |
282 |
– |
clientfile::_tool("file:$toolname"); |
283 |
– |
closeclientfile; |
303 |
|
} |
304 |
|
|
305 |
|
sub help_setup { |
306 |
|
|
307 |
|
print <<ENDTEXT; |
308 |
|
Allows installation of a new tool/external package into an already |
309 |
< |
existing area. |
309 |
> |
existing area. If not toolname is specified, the complete installation |
310 |
> |
process is initiated. |
311 |
|
|
312 |
|
Usage: |
313 |
|
|
314 |
< |
$bold scram setup $normal toolname |
314 |
> |
$bold scram setup $normal [toolname] |
315 |
|
|
316 |
|
toolname : The name of the tool setup file required. |
317 |
|
ENDTEXT |