ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Configuration/ConfigArea.pm
(Generate patch)

Comparing COMP/SCRAM/src/Configuration/ConfigArea.pm (file contents):
Revision 1.9 by williamc, Wed Feb 23 13:24:13 2000 UTC vs.
Revision 1.13 by williamc, Mon Mar 13 10:23:19 2000 UTC

# Line 23 | Line 23
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
# Line 62 | Line 64 | sub init {
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");
# Line 70 | Line 75 | sub init {
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  
# Line 87 | Line 93 | sub basearea {
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   }
# Line 134 | Line 140 | sub setup {
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");
# Line 176 | Line 183 | sub bootstrapfromlocation {
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 {
# Line 330 | Line 342 | sub addconfigitem {
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;
# Line 443 | Line 461 | sub Structure_Start {
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'}} ) {
# Line 459 | Line 477 | sub Structure_Start {
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'}}=

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines