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.5 by sashby, Wed Feb 2 20:16:45 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        {
# Line 252 | Line 252 | sub toolsetup()
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 317 | Line 324 | sub toolsetup()
324           # Get file from download cache:
325           ($url,$filename)=$self->{urlhandler}->get($url);
326           use File::Copy;
327 <         $tfname=$self->{toolfiledir}."/".$toolname;
327 >         $tfname=$self->{toolfiledir}."/".$toolname;    
328           copy($filename, $tfname);
329 +         my $mode = 0644; chmod $mode, $tfname;
330           $toolfile=$tfname;
331           }
332        else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines