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.5 by sashby, Wed Feb 2 20:16:45 2005 UTC vs.
Revision 1.6 by sashby, Wed Apr 6 18:10:33 2005 UTC

# Line 238 | Line 238 | sub toolsetup()
238     my ($arealocation, $toolname, $toolversion, $toolurl) = @_;
239     my ($urlcache, $url, $filename, $tfname);
240     my $toolfile;
241 <
241 >  
242     $toolname =~ tr[A-Z][a-z];
243     $toolversion ||= $self->defaultversion($toolname);
244     $urlcache=URL::URLcache->new($arealocation."/.SCRAM/cache"); # Download tool cache
245 <
245 >  
246     # Check for the downloaded tools cache:
247     if (defined($urlcache))
248        {
249        $self->{urlhandler}=URL::URLhandler->new($urlcache);
250        }
251 <  
251 >
252     $url = $self->toolurls()->{$toolname};
253     $filename = $self->{toolfiledir}."/".$toolname;
254    
# Line 320 | 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 <         my $mode = 0644; chmod $mode, $tfname;
330 <         $toolfile=$tfname;
323 >         # If the URL is empty, the chances are that this tool was not downloaded to .SCRAM/InstalledTools. We
324 >         # give a warning and continue:
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