70 |
|
|
71 |
|
sub cache { |
72 |
|
my $self=shift; |
73 |
+ |
|
74 |
|
if ( @_ ) { |
75 |
< |
$self->{cache}=shift; |
75 |
> |
$self->{cache}=shift; |
76 |
|
} |
77 |
< |
elsif ( ! defined $self->{cache} ) { |
77 |
> |
if ( ! defined $self->{cache} ) { |
78 |
|
my $loc=$self->location()."/".$self->{admindir}."/".$self->{cachedir}; |
79 |
< |
$self->{cache}=URL::URLcache->new($loc); |
79 |
> |
if ( -e $loc ) { |
80 |
> |
$self->{cache}=URL::URLcache->new($loc); |
81 |
> |
} |
82 |
> |
else { |
83 |
> |
$self->{cache}=undef; |
84 |
> |
} |
85 |
|
} |
86 |
|
return $self->{cache}; |
87 |
|
} |
88 |
|
|
89 |
+ |
sub _newcache { |
90 |
+ |
my $self=shift; |
91 |
+ |
my $loc=$self->location()."/".$self->{admindir}."/".$self->{cachedir}; |
92 |
+ |
$self->{cache}=URL::URLcache->new($loc); |
93 |
+ |
return $self->{cache}; |
94 |
+ |
} |
95 |
+ |
|
96 |
+ |
sub _newobjectstore { |
97 |
+ |
my $self=shift; |
98 |
+ |
my $loc=$self->location()."/".$self->{admindir}."/".$self->{dbdir}; |
99 |
+ |
$self->{dbstore}=ObjectUtilities::ObjectStore->new($loc); |
100 |
+ |
return $self->{dbstore}; |
101 |
+ |
} |
102 |
+ |
|
103 |
|
sub objectstore { |
104 |
|
my $self=shift; |
105 |
+ |
|
106 |
|
if ( @_ ) { |
107 |
< |
$self->{dbstore}=shift; |
107 |
> |
$self->{dbstore}=shift; |
108 |
|
} |
109 |
< |
elsif ( ! defined $self->{dbstore} ) { |
109 |
> |
if ( ! defined $self->{dbstore} ) { |
110 |
|
my $loc=$self->location()."/".$self->{admindir}."/".$self->{dbdir}; |
111 |
< |
$self->{dbstore}=ObjectUtilities::ObjectStore->new($loc); |
111 |
> |
if ( -e $loc ) { |
112 |
> |
$self->{dbstore}=ObjectUtilities::ObjectStore->new($loc); |
113 |
> |
} |
114 |
> |
else { |
115 |
> |
$self->{dbstore}=undef; |
116 |
> |
} |
117 |
|
} |
118 |
|
return $self->{dbstore} |
119 |
|
} |
163 |
|
AddDir::adddir($workloc); |
164 |
|
|
165 |
|
# -- add a cache |
166 |
< |
$self->cache(); |
166 |
> |
$self->_newcache(); |
167 |
> |
|
168 |
> |
# -- add an Objectstore |
169 |
> |
$self->_newobjectstore(); |
170 |
|
|
171 |
|
# -- Save Environment File |
172 |
|
$self->_SaveEnvFile(); |
184 |
|
sub toolbox { |
185 |
|
my $self=shift; |
186 |
|
if ( ! defined $self->{toolbox} ) { |
187 |
< |
$self->{toolbox}=BuildSystem::ToolBox->new($self); |
187 |
> |
$self->{toolbox}=BuildSystem::ToolBox->new($self, $ENV{SCRAM_ARCH}); |
188 |
|
} |
189 |
|
return $self->{toolbox}; |
190 |
|
} |
254 |
|
|
255 |
|
sub searchlocation { |
256 |
|
my $self=shift; |
257 |
< |
|
257 |
> |
|
258 |
|
#start search in current directory if not specified |
259 |
|
my $thispath; |
260 |
|
if ( @_ ) { |
263 |
|
else { |
264 |
|
$thispath=cwd(); |
265 |
|
} |
266 |
< |
|
266 |
> |
|
267 |
|
my $rv=0; |
268 |
|
|
269 |
|
# chop off any files - we only want dirs |
279 |
|
last Sloop; |
280 |
|
} |
281 |
|
} while ( ($thispath=~s/(.*)\/.*/$1/)=~/./ ) }; |
282 |
< |
|
282 |
> |
|
283 |
|
return $rv?$thispath:undef; |
284 |
|
} |
285 |
|
|
321 |
|
$sat->setup(@_); |
322 |
|
|
323 |
|
# -- copy across the cache and ObjectStore |
324 |
< |
copy($self->cache()->location(),$sat->cache()->location()); |
325 |
< |
copy($self->objectstore()->location(),$sat->objectstore()->location()); |
324 |
> |
# -- make sure we dont try building new caches in release areas |
325 |
> |
my $rcache=$self->cache(); |
326 |
> |
if ( defined $rcache ) { |
327 |
> |
copy($rcache->location(),$sat->cache()->location()); |
328 |
> |
} |
329 |
> |
|
330 |
> |
# -- make sure we dont try building new objectstores in release areas |
331 |
> |
my $rostore=$self->objectstore(); |
332 |
> |
if ( defined $rostore ) { |
333 |
> |
copy($rostore->location(),$sat->objectstore()->location()); |
334 |
> |
} |
335 |
|
|
336 |
|
# and make sure in reinitialises |
337 |
|
undef ($sat->{cache}); |