41 |
|
# archname() : get/set a string to indicate architecture |
42 |
|
# archdir() : return the location of the administration arch dep |
43 |
|
# directory |
44 |
< |
# objectstore() : return the objectStore object of the area |
44 |
> |
# objectstore(["<"]) : return the objectStore object of the area |
45 |
> |
# if called with temp - will set as undef |
46 |
> |
# if it dosnt already exist - otherwise will |
47 |
> |
# attempt to create it. |
48 |
|
# - temporary |
49 |
|
# align() : adjust hard paths to suit local loaction |
50 |
|
|
73 |
|
|
74 |
|
sub cache { |
75 |
|
my $self=shift; |
76 |
+ |
|
77 |
+ |
my $exist=0; |
78 |
|
if ( @_ ) { |
79 |
< |
$self->{cache}=shift; |
79 |
> |
my $cache=shift; |
80 |
> |
if ( $cache!~/^</ ) { |
81 |
> |
$self->{cache}=$cache; |
82 |
> |
} |
83 |
> |
$exist=1; |
84 |
|
} |
85 |
|
elsif ( ! defined $self->{cache} ) { |
86 |
|
my $loc=$self->location()."/".$self->{admindir}."/".$self->{cachedir}; |
87 |
< |
$self->{cache}=URL::URLcache->new($loc); |
87 |
> |
if ( ! $exist ) { |
88 |
> |
$self->{cache}=URL::URLcache->new($loc); |
89 |
> |
} |
90 |
|
} |
91 |
|
return $self->{cache}; |
92 |
|
} |
93 |
|
|
94 |
|
sub objectstore { |
95 |
|
my $self=shift; |
96 |
+ |
|
97 |
+ |
my $exist=""; |
98 |
|
if ( @_ ) { |
99 |
< |
$self->{dbstore}=shift; |
99 |
> |
my $db=shift; |
100 |
> |
if ( $db!~/^</ ) { |
101 |
> |
$self->{dbstore}=cache; |
102 |
> |
} |
103 |
> |
$exist="<"; |
104 |
|
} |
105 |
|
elsif ( ! defined $self->{dbstore} ) { |
106 |
|
my $loc=$self->location()."/".$self->{admindir}."/".$self->{dbdir}; |
107 |
< |
$self->{dbstore}=ObjectUtilities::ObjectStore->new($loc); |
107 |
> |
$self->{dbstore}=ObjectUtilities::ObjectStore->new($exist.$loc); |
108 |
|
} |
109 |
|
return $self->{dbstore} |
110 |
|
} |
309 |
|
$sat->setup(@_); |
310 |
|
|
311 |
|
# -- copy across the cache and ObjectStore |
312 |
< |
copy($self->cache()->location(),$sat->cache()->location()); |
313 |
< |
copy($self->objectstore()->location(),$sat->objectstore()->location()); |
312 |
> |
# -- make sure we dont try building new caches in release areas |
313 |
> |
my $rcache=$self->cache("<"); |
314 |
> |
if ( defined $rcache ) { |
315 |
> |
copy($rcache->location(),$sat->cache()->location()); |
316 |
> |
} |
317 |
> |
|
318 |
> |
# -- make sure we dont try building new objectstores in release areas |
319 |
> |
my $rostore=$self->objectstore("<"); |
320 |
> |
if ( defined $rostore ) { |
321 |
> |
copy($rostore->location(),$sat->objectstore()->location()); |
322 |
> |
} |
323 |
|
|
324 |
|
# and make sure in reinitialises |
325 |
|
undef ($sat->{cache}); |