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

Comparing COMP/SCRAM/src/BuildSystem/ToolManager.pm (file contents):
Revision 1.3 by sashby, Wed Feb 2 17:41:41 2005 UTC vs.
Revision 1.7 by sashby, Wed Apr 6 18:17:15 2005 UTC

# Line 248 | Line 248 | sub toolsetup()
248        {
249        $self->{urlhandler}=URL::URLhandler->new($urlcache);
250        }
251 <  
251 >
252     $url = $self->toolurls()->{$toolname};
253     $filename = $self->{toolfiledir}."/".$toolname;
254    
255 +   # If .SCRAM/InstalledTools doesn't exist, create it:
256 +   if (! -d $self->{toolfiledir})
257 +      {
258 +      AddDir::adddir($self->{toolfiledir});
259 +      }
260 +  
261     # First, check to see if there was a tool URL given. If so, we might need to read
262     # from http or from a file: type URL:
263     if (my ($proto, $urlv) = ($toolurl =~ /(.*):(.*)/))
# Line 266 | Line 272 | sub toolsetup()
272              {
273              use File::Copy;
274              copy($urlv, $filename);
275 +            my $mode = 0644; chmod $mode, $filename;
276              $toolfile=$filename;
277              }
278           else
# Line 313 | Line 320 | sub toolsetup()
320        # Copy the downloaded tool file to InstalledTools directory:
321        if ( ! -f $filename )
322           {
323 <         $self->verbose("Attempting Download of $url");
324 <         # Get file from download cache:
325 <         ($url,$filename)=$self->{urlhandler}->get($url);
326 <         use File::Copy;
327 <         $tfname=$self->{toolfiledir}."/".$toolname;
328 <         copy($filename, $tfname);
329 <         $toolfile=$tfname;
323 >         # If the URL is empty, the chances are that this tool was not downloaded to .SCRAM/InstalledTools.
324 >         # We signal an error and exit:
325 >         if ($url eq '')
326 >            {
327 >            $::scram->scramerror("$toolname was selected in project requirements but is not in the configuration!");
328 >            }
329 >         else
330 >            {
331 >            # Otherwise, we try to download it:
332 >            $self->verbose("Attempting Download of $url");
333 >            # Get file from download cache:
334 >            ($url,$filename)=$self->{urlhandler}->get($url);                
335 >            use File::Copy;
336 >            $tfname=$self->{toolfiledir}."/".$toolname;  
337 >            copy($filename, $tfname);
338 >            my $mode = 0644; chmod $mode, $tfname;
339 >            $toolfile=$tfname;
340 >            }
341           }
342        else
343           {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines