69 |
|
{ |
70 |
|
my $self=shift; |
71 |
|
my $projectarea=shift; |
72 |
< |
|
72 |
> |
|
73 |
|
# Change cache settings to reflect the new location: |
74 |
|
$self->{topdir}=$projectarea->location(); |
75 |
|
|
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 |
|
{ |
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 =~ /(.*):(.*)/)) |
323 |
|
# Get file from download cache: |
324 |
|
($url,$filename)=$self->{urlhandler}->get($url); |
325 |
|
use File::Copy; |
326 |
< |
$tfname=$self->{toolfiledir}."/".$toolname; |
326 |
> |
$tfname=$self->{toolfiledir}."/".$toolname; |
327 |
|
copy($filename, $tfname); |
328 |
|
$toolfile=$tfname; |
329 |
|
} |