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.14 by williamc, Thu Mar 25 15:42:48 1999 UTC vs.
Revision 1.22 by williamc, Wed Apr 14 09:46:02 1999 UTC

# Line 7 | Line 7 | $inputcmd=shift;
7   $found='false';
8   $bold  = "\033[1m";
9   $normal = "\033[0m";
10 < @allowed_commands=qw(project build env install version list arch setup);
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/ ) ) {
25 <        print "scram help\n----------\n";
24 <        print "Recognised Commands: \n";
25 >        helpheader('Recognised Commands');
26          foreach $command ( @allowed_commands ) {
27 <        print "       ".$command."\n";  
27 >        print "      $bold scram ".$command.$normal."\n";      
28          }
29 +        print "\n";
30 +        print "Help on individual commands available through\n\n";
31 +        print "$bold       scram".$normal." command$bold help $normal\n\n";
32   }
33  
34   sub help_build {
# Line 53 | 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
60           chdir $ENV{LOCALTOP};
61           &localtop;
66             LoadEnvFile();
67             #
68             # Now create the directories specified in the interface
# Line 75 | Line 79 | sub project {
79             use clientfile;
80             BuildClientFile( $ENV{SCRAM_ProjReqsDoc} );
81             use Cwd;
82 <           print "Installation Located at:\n".cwd()."\n";
83 <           ReturnToContinue();
82 >           print "\nInstallation Procedure Complete. \n".
83 >                        "Installation Located at:\n".cwd()."\n";
84   }
85  
86   sub FullEnvInit {
# Line 127 | Line 131 | sub localtop {
131          } while ( ( $thispath=~s/(.*)\/.*/$1/ )=~/./  );
132          if ( ! (defined $ENV{LOCALTOP}) ) {
133           print "Unable to locate the top of local release. Exiting\n";
134 <         ReturnToContinue();
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 170 | Line 174 | sub install ( $tagname, $version ) {
174          my $filename="$ENV{SCRAM_CONFIG}/project.lookup";
175          my $outfile="$ENV{SCRAM_CONFIG}/project.lookup.tmp";
176          open ( LOCALLOOKUPDB, "<$filename" );
177 <        open ( OUTFILE , ">$outfile" );
177 >        open ( OUTFILE , ">$outfile" ) or die "Unable to open $outfile $!\n";
178          while ( <LOCALLOOKUPDB> ) {
179              if ( /^$tagname/ ) {
180                  print "Related tag :".$_."\n";
# Line 254 | Line 258 | sub arch {
258          print "$ENV{SCRAM_ARCH}\n";
259   }
260  
257 sub ReturnToContinue {
258           print "Press RETURN to exit\n";
259           $junk=<STDIN>;
260 }
261  
262   #
263   # Setup a new tool
# Line 271 | 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          }
281        # Parse the toolfile and update the clientsettings file
282        # currently just append to the end
283        use clientfile;
284        clientfile::openclientfile('add');
285        clientfile::_tool("file:$toolname");
286        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