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

Comparing COMP/SCRAM/src/BuildSystem/ToolDoc.pm (file contents):
Revision 1.1.2.12 by williamc, Tue Jun 20 15:27:40 2000 UTC vs.
Revision 1.1.2.14.2.1 by williamc, Thu Aug 10 12:44:37 2000 UTC

# Line 26 | Line 26 | sub new {
26          my $class=shift;
27          $self={};
28          bless $self, $class;
29 +        $self->{cache}=shift;
30 +        $self->{mydoctype}="BuildSystem::ToolDoc";
31 +        $self->{mydocversion}="1.0";
32          $self->init();
33          return $self;
34   }
# Line 100 | Line 103 | sub setup {
103          $self->{tool}->version($version);
104          $self->{switch}->filetoparse($file);
105          $self->{toolfound}=1;
106 +        # -- check the type of document - can we parse it?
107 +        my($doctype,$docversion)=$self->{switch}->doctype();
108 +        if ( ($doctype ne $self->{mydoctype}) ||
109 +                ($self->{mydocversion} ne $docversion) ) {
110 +          $self->error("Unable to Parse Document of type $doctype $docversion".
111 +                "\n(Only ".$self->{mydoctype}." ". $self->{mydocversion}.")");
112 +        }
113          $self->{switch}->parse("setup");
114          return $self->{toolfound};
115   }
# Line 257 | Line 267 | sub _toolparamcopy {
267          my $param=shift;
268  
269          my $rv=0;
270 +        my @params=();
271          $self->verbose("Check Other Projects for tool");
272          my @validtools=$self->_searchtools($tool);
273          if ( ! $self->interactive() ) {
274            if ( $#validtools >=0 ) {
275 <           my @params=$validtools[0]->getfeature($param);
275 >           @params=$validtools[0]->getfeature($param);
276             if ( $#params >=0 ) {
277                  $self->verbose("Extracting Feature $param from tool".
278                          " (= @params )\n");
279 <                $tool->setfeature($param,@params);
279 >                #$tool->setfeature($param,@params);
280                  $rv=1;
281             }
282            }
283          }
284 <        return $rv;
284 >        return ($rv,@params);
285   }
286  
287   # -- Tag Routines
# Line 349 | Line 360 | sub Environment_Start {
360            }
361            elsif ( ! $self->interactive() ) {
362             # check other installed copies of the tool
363 <           if ( $self->_toolparamcopy($self->{tool},$$hashref{'name'}) ) {
364 <              my @tmp=$self->{tool}->getfeature($$hashref{'name'});
365 <              $self->{Envvalue}=$tmp[0]; # assume single val parameter!
363 >           my ($rv,@params)=
364 >                $self->_toolparamcopy($self->{tool},$$hashref{'name'});
365 >           if ( $rv && ($#params == 0)) { #dont use multivalued params!
366 >              $self->{Envvalue}=$params[0]; # single val parameter
367             }
368             elsif ( defined $ENV{$$hashref{'name'}} ) {
369                # check the environment

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines