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

Comparing COMP/SCRAM/src/Scram/ScramFunctions.pm (file contents):
Revision 1.11 by sashby, Wed May 30 12:47:01 2001 UTC vs.
Revision 1.21 by sashby, Tue May 21 10:57:34 2002 UTC

# Line 82 | Line 82 | sub project {
82          return $area;
83   }
84  
85 < sub setuptoolsinarea {
86 <        my $self=shift;
87 <        my $area=shift;
88 <
89 <        # -- initialise
90 <        $self->_allprojectinitsearcher();
91 <
92 <        # -- create a new toolbox object
93 <        my $toolbox=$self->areatoolbox($area);
94 <        $toolbox->searcher($self->_allprojectinitsearcher());
95 <
96 <        if ( @_ ) {
97 <            # -- specific tool specified
98 <            if ( my $rv=$toolbox->toolsetup(@_) ) {
99 <             if ( $rv eq 1 ) {
100 <                print "Unknown tool $toolname @ARGV\n";
101 <                exit 1;
102 <             }
103 <            }
104 <        }
105 <        else {
106 <            # -- setup all tools specified in the requirements doc
107 <            my $reqs=$self->arearequirements($area);
108 <            $self->verbose("Setup ToolBox from Requirements doc ($reqs)");
109 <            $reqs->setup($toolbox);
110 <        }
111 < }
85 > sub setuptoolsinarea
86 >   {
87 >   my $self=shift;
88 >   my $area=shift;
89 >  
90 >   # -- initialise
91 >   print "Initialising setup procedure......","\n";
92 >   $self->_allprojectinitsearcher();
93 >  
94 >   # -- create a new toolbox object
95 >   my $toolbox=$self->areatoolbox($area);
96 >   $toolbox->searcher($self->_allprojectinitsearcher());
97 >  
98 >   if ( @_ )
99 >      {
100 >      # -- specific tool specified
101 >      if ( my $rv=$toolbox->toolsetup(@_) )
102 >         {
103 >         if ( $rv eq 1 )
104 >            {
105 >            print "Unknown tool $toolname @ARGV\n";
106 >            exit 1;
107 >            }
108 >         }
109 >      }
110 >   else
111 >      {
112 >      # -- setup all tools specified in the requirements doc
113 >      print "Going to set up all tools....","\n\n";
114 >      my $reqs=$self->arearequirements($area);    
115 >      $self->verbose("Setup ToolBox from Requirements doc ($reqs)");
116 >      # reqs is a BuildSystem::Requirements object:
117 >      $reqs->setup($toolbox);
118 >      }
119 >   }
120  
121   sub satellite {
122          my $self=shift;
# Line 136 | Line 144 | sub satellite {
144          my $area=$relarea->satellite($installarea,$areaname);
145          $area->archname($self->arch());
146  
139        # -- copy setup info - deprecated by toolbox copy method
140        #$relarea->copysetup($area->location());
141
147          # -- copy toolbox
148          my $rtb=$self->areatoolbox($relarea);
149          my $tb=$self->areatoolbox($area);
# Line 241 | Line 246 | sub addareatoDB {
246          $self->scramprojectdb()->addarea($tagname,$version,$area);
247   }
248  
244 sub spawnversion {
245        my $self=shift;
246        my $version=shift;
249  
250 <        my $rv=0;
251 <        my $thisversion=$self->getversion();
252 <        if ( defined $version ) {
253 <          if ( $version ne $thisversion ) {
254 <              # first try to use the correct version
255 <              if ( -d $self->{scram_top}."/".$version ) {
256 <                $ENV{SCRAM_HOME}=$self->{scram_top}."/".$version;
257 <                $ENV{TOOL_HOME}="$ENV{SCRAM_HOME}/src";
258 <                $self->verbose("Spawning SCRAM version $version");
259 <                my $rv=system("scram", @_)/256;
260 <                exit $rv;
261 <              }
262 <              else { # if not then simply warn
263 <               print "******* Warning : scram version inconsistent ********\n";
264 <               print "This version: $thisversion; Required version: $version\n";
265 <               print "*****************************************************\n";
266 <               print "\n";
267 <              }
268 <           }
269 <        }
270 <        else {
271 <           $self->error("Undefined value for version requested");
272 <           $rv=1;
273 <        }
274 <        return $rv;
275 < }
250 > sub removeareafromDB
251 >   {
252 >   ###############################################################
253 >   # removearefromDB()                                           #
254 >   ###############################################################
255 >   # modified : Thu Jun 14 10:46:22 2001 / SFA                   #
256 >   # params   : projectname, projectversion                      #
257 >   #          :                                                  #
258 >   #          :                                                  #
259 >   #          :                                                  #
260 >   # function : Remove project <projectname> from DB file.       #
261 >   #          :                                                  #
262 >   #          :                                                  #
263 >   ###############################################################
264 >   my $self=shift;
265 >   my $projname=shift;
266 >   my $version=shift;
267 >  
268 >   # -- Remove from the DB:
269 >   $self->scramprojectdb()->removearea($projname,$version);
270 >   }
271 >
272 >
273 > sub spawnversion
274 >   {
275 >   ###############################################################
276 >   # spawnversion                                                #
277 >   ###############################################################
278 >   # modified : Fri Aug 10 15:42:08 2001 / SFA                   #
279 >   # params   :                                                  #
280 >   #          :                                                  #
281 >   #          :                                                  #
282 >   #          :                                                  #
283 >   # function : Check for version of scram to run, and run it.   #
284 >   #          :                                                  #
285 >   #          :                                                  #
286 >   ###############################################################
287 >
288 >   my $self=shift;
289 >   my $version=shift;
290 >   my $rv=0;
291 >  
292 >   my $thisversion=$self->getversion();
293 >
294 >   if ( defined $version )
295 >      {
296 >      if ( $version ne $thisversion )
297 >         {
298 >         # first try to use the correct version
299 >         if ( -d $self->{scram_top}."/".$version )
300 >            {
301 >            $ENV{SCRAM_HOME}=$self->{scram_top}."/".$version;
302 >            $ENV{TOOL_HOME}="$ENV{SCRAM_HOME}/src";
303 >            $self->verbose("Spawning SCRAM version $version");
304 >            my $rv=system("scram", @_)/256;
305 >            exit $rv;
306 >            }
307 >         else
308 >            {
309 >            # if not then simply warn. Send output to STDERR:
310 >            if ( -t STDERR )
311 >               {
312 >               print STDERR "******* Warning : scram version inconsistent ********\n";
313 >               print STDERR "This version: $thisversion; Required version: $version\n";
314 >               print STDERR "*****************************************************\n";
315 >               print STDERR "\n";
316 >               }    
317 >            }
318 >         }
319 >      }
320 >   else
321 >      {
322 >      $self->error("Undefined value for version requested");
323 >      $rv=1;
324 >      }
325 >   return $rv;
326 >   }
327  
328   sub globalcache {
329          my $self=shift;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines