23 |
|
# restore(location) : restore data from file location |
24 |
|
# meta() : return a description string of the area |
25 |
|
# addconfigitem(url) : add a new item to the area |
26 |
+ |
# storeconfigobject(confiItemobj) : store a ready made ConfigItem in the local |
27 |
+ |
# area |
28 |
|
# configitem(@keys) : return a list of fig items that match |
29 |
|
# the keys - all if left blank |
30 |
|
# parentstore() : set/return the parent ObjectStore |
64 |
|
$self->newparse("init"); |
65 |
|
$self->newparse("download"); |
66 |
|
$self->newparse("setup"); |
67 |
+ |
$self->newparse("setup_tools"); |
68 |
+ |
$self->addarchtags("setup_tools"); |
69 |
+ |
$self->addarchtags("setup"); |
70 |
|
$self->addtag("init","project",\&Project_Start,$self, |
71 |
|
\&Project_text,$self,"", $self ); |
72 |
|
$self->addurltags("download"); |
75 |
|
$self->addtag("download","use",\&Use_download_Start,$self, |
76 |
|
"", $self, "",$self); |
77 |
|
$self->addurltags("setup"); |
78 |
< |
$self->addtag("setup","use",\&Use_Start,$self, "", $self, "",$self); |
78 |
> |
$self->addurltags("setup_tools"); |
79 |
> |
$self->addtag("setup_tools","use",\&Use_Start,$self, "", $self, "",$self); |
80 |
|
$self->addtag("setup","structure",\&Structure_Start,$self, |
81 |
|
"", $self, "",$self); |
82 |
|
|
93 |
|
$self->config()->store($area,"BaseArea"); |
94 |
|
} |
95 |
|
else { |
96 |
< |
($area)=$self->config()->restore("BaseArea"); |
96 |
> |
($area)=$self->config()->find("BaseArea"); |
97 |
|
} |
98 |
|
return $area; |
99 |
|
} |
140 |
|
|
141 |
|
# --- and parse the setup file |
142 |
|
$self->parse("setup"); |
143 |
+ |
$self->parse("setup_tools"); |
144 |
|
|
145 |
|
# --- store bootstrap info |
146 |
|
$self->store($self->location()."/".$self->{admindir}."/ConfigArea.dat"); |
183 |
|
if ( ! defined $self->location(@_) ) { |
184 |
|
$self->error("Unable to locate the top of local configuration area"); |
185 |
|
} |
186 |
< |
print "Found top ".$self->location()."\n"; |
186 |
> |
$self->verbose("Found top ".$self->location()); |
187 |
|
$self->_setupstore(); |
188 |
< |
$self->restore($self->location()."/".$self->{admindir}. |
189 |
< |
"/ConfigArea.dat"); |
188 |
> |
my $infofile=$self->location()."/".$self->{admindir}."/ConfigArea.dat"; |
189 |
> |
if ( -e $infofile ) { |
190 |
> |
$self->restore($infofile); |
191 |
> |
} |
192 |
> |
else { |
193 |
> |
$self->error("Area corrupted - cannot find $infofile"); |
194 |
> |
} |
195 |
|
} |
196 |
|
|
197 |
|
sub parentconfig { |
342 |
|
# $self->config()->storepolicy("local"); |
343 |
|
} |
344 |
|
|
345 |
+ |
sub storeconfigobject { |
346 |
+ |
my $self=shift; |
347 |
+ |
my $obj=shift; |
348 |
+ |
$obj->save($self->config()); |
349 |
+ |
} |
350 |
+ |
|
351 |
|
sub downloadtotop { |
352 |
|
my $self=shift; |
353 |
|
my $url=shift; |
461 |
|
my $hashref=shift; |
462 |
|
|
463 |
|
$self->checktag($name,$hashref,'name'); |
464 |
< |
if ( !( exists $$hashref{'type'}) || ( exists $$hashref{'url'}) ) { |
464 |
> |
if ( !(( exists $$hashref{'type'}) || ( exists $$hashref{'url'})) ) { |
465 |
|
$self->parseerror("No url or type given in <$name> tag"); |
466 |
|
} |
467 |
|
if ( ! exists $self->{structures}{$$hashref{'name'}} ) { |
477 |
|
$self->{structures}{$$hashref{'name'}}->name($$hashref{'name'}); |
478 |
|
$self->{structures}{$$hashref{'name'}}->parent($self); |
479 |
|
$self->{structures}{$$hashref{'name'}}->vars($hashref); |
480 |
+ |
$self->{structures}{$$hashref{'name'}}->arch($self->arch()); |
481 |
|
} |
482 |
|
else { # its an activedoc |
483 |
|
$self->{structures}{$$hashref{'name'}}= |