ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/scram
(Generate patch)

Comparing COMP/SCRAM/src/scram (file contents):
Revision 1.18 by williamc, Tue Mar 30 08:53:35 1999 UTC vs.
Revision 1.22 by williamc, Wed Apr 14 09:46:02 1999 UTC

# Line 9 | Line 9 | $bold  = "\033[1m";
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/ ) ) {
# Line 55 | Line 57 | sub project {
57          use File::Copy;
58          use Utilities::AddDir;
59          
60 +           &localtop;
61 +           chdir $ENV{LOCALTOP};
62             use BootStrapProject;
63             # get the bootstrap files downloaded
64             BootStrapProject("$project\?\?$version");
65             # Go setup the rest of the environement, now we can
62           chdir $ENV{LOCALTOP};
63           &localtop;
66             LoadEnvFile();
67             #
68             # Now create the directories specified in the interface
# Line 77 | Line 79 | sub project {
79             use clientfile;
80             BuildClientFile( $ENV{SCRAM_ProjReqsDoc} );
81             use Cwd;
82 <           print "Installation Located at:\n".cwd()."\n";
82 >           print "\nInstallation Procedure Complete. \n".
83 >                        "Installation Located at:\n".cwd()."\n";
84   }
85  
86   sub FullEnvInit {
# Line 131 | Line 134 | sub localtop {
134           exit 1;
135          }
136          } #end block
137 <        ($ENV{THISDIR}=cwd)=~s/^$ENV{LOCALTOP}//;
137 >        ($ENV{THISDIR}=cwd)=~s/^\Q$ENV{LOCALTOP}\L//;
138          $ENV{THISDIR}=~s/^\///;
139          $ENV{SCRAM_WORKDIR}="$ENV{LOCALTOP}/.SCRAM";
140   }
# Line 268 | Line 271 | sub setup {
271            $ENV{SCRAM_BootStrapFiles}="$ENV{LOCALTOP}/.SCRAM:".
272                          $ENV{SCRAM_BootStrapFiles};
273          }
274 <        # Check for the correct toolfile
275 <        # ideally try and download it if not already in .SCRAM
276 <        # Only scram toolbox files supported so far
277 <        if ( ! -e "$ENV{LOCALTOP}/.SCRAM/$toolname" ) {
274 >        # If no toolname specified then its a full setup
275 >        if ( $toolname eq "" ) {
276 >           my $filebase="$ENV{LOCALTOP}/.SCRAM/$ENV{SCRAM_ARCH}";
277 >           rename "$filebase/clientsettings", "$filebase/clientsettings.old";
278 >           rename "$filebase/clientsettings_reqs",
279 >                                "$filebase/clientsettings_reqs.old";
280 >           use clientfile;
281 >           BuildClientFile( $ENV{SCRAM_ProjReqsDoc} );
282 >        }
283 >        else {
284 >          # Check for the correct toolfile
285 >          # ideally try and download it if not already in .SCRAM
286 >          # Only scram toolbox files supported so far
287 >          if ( ! -e "$ENV{LOCALTOP}/.SCRAM/$toolname" ) {
288                  &urlhandler::urlhandler("file:$ENV{SCRAM_HOME}/toolbox/"
289                          .$toolname, "$ENV{LOCALTOP}/.SCRAM/$toolname") ;
290 +          }
291 +          # Parse the toolfile and update the clientsettings file
292 +          # currently just append to the end
293 +          use clientfile;
294 +          clientfile::openclientfile('add');
295 +          clientfile::_tool("file:$toolname");
296 +          closeclientfile;
297          }
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;
298   }
299  
300   sub help_setup {
301  
302   print <<ENDTEXT;
303   Allows installation of a new tool/external package into an already
304 < existing area.
304 > existing area. If not toolname is specified, the complete installation
305 > process is initiated.
306  
307   Usage:
308  
309 <                 $bold scram setup $normal toolname
309 >                 $bold scram setup $normal [toolname]
310  
311   toolname : The name of the tool setup file required.
312   ENDTEXT

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines