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.2 by williamc, Tue Apr 18 09:18:59 2000 UTC vs.
Revision 1.1.2.10 by williamc, Fri May 5 14:18:45 2000 UTC

# Line 12 | Line 12
12   # new()         : A new ToolDoc object
13   # tool(toolobj) : set the tool object for the class
14   # setup(file,$name,$version) : setup a tool object from the specified file
15 + #                               return 0 for OK 1 for cancel
16   # interactive([0|1]) : set the interactive node 0=off 1=on
17  
18   package BuildSystem::ToolDoc;
# Line 52 | Line 53 | sub init {
53                                          "", $self,
54                                          \&Arch_End,$self);
55          $self->{Arch}=1;
56 <        push @{$self->{ARCHBLOCK}}, $Arch;
56 >        push @{$self->{ARCHBLOCK}}, $self->{Arch};
57  
58   }
59  
# Line 82 | Line 83 | sub setup {
83          $self->{tool}->name($name);
84          $self->{tool}->version($version);
85          $self->{switch}->filetoparse($file);
86 +        $self->{toolfound}=1;
87          $self->{switch}->parse("setup");
88 +        return $self->{toolfound};
89   }
90  
91   sub featuretext {
# Line 240 | Line 243 | sub Tool_Start {
243                  allowgroup("Toolactive",$self->{switch}->currentparsename());
244            $self->{ToolEnv}{'SCRAMtoolname'}=$$hashref{'name'};
245            $self->{ToolEnv}{'SCRAMtoolversion'}=$$hashref{'version'};
246 +          $self->{toolfound}=0;
247          }
248          else {
249            $self->{switch}->disallowgroup("Toolactive",
# Line 269 | Line 273 | sub Environment_Start {
273            $self->{currentenvtext}="";
274            $self->{EnvContext}=$$hashref{'name'};
275            undef $self->{Envvalue};
276 <          if ( exists $$hahsref{'type'} ) {
277 <            $self->{tool}->type($$hashref{'name'},$$hahsref{'type'});
276 >          if ( exists $$hashref{'type'} ) {
277 >            $$hashref{'type'}=~tr[A-Z][a-z];
278 >            $self->{tool}->type($$hashref{'name'},$$hashref{'type'});
279            }
280            if ( exists $$hashref{'value'}) {
281              $self->{Envvalue}=$$hashref{'value'};
282            }
283            elsif ( ! $self->interactive() ) {
284 <           if ( $self->_checkdefault($hashref) ) {
284 >           # check the environment
285 >           if ( defined $ENV{$$hashref{'name'}} ) {
286 >            $self->{Envvalue}=$ENV{$$hashref{'name'}};
287 >           }
288 >           elsif ( $self->_checkdefault($hashref) ) {
289              $self->{Envvalue}=$$hashref{'default'};
290             }
291            }
# Line 299 | Line 308 | sub Environment_End {
308  
309          if ( $self->{Arch} ) {
310            if ( ! defined $self->{EnvContext} ) {
311 <            $self->parseerror("</\$name> without an opening context");
311 >            $self->{switch}->parseerror("</$name> without an opening context");
312            }
313            # - set the help text
314            $self->featuretext($self->{EnvContext},$self->{currentenvtext});
# Line 342 | Line 351 | sub Arch_Start {
351          my $name=shift;
352          my $hashref=shift;
353  
354 <        $toolswitch->checktag($name, $hashref,'name');
354 >        $self->{switch}->checktag($name, $hashref,'name');
355          ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
356                                                  : ($self->{Arch}=0);
357          push @{$self->{ARCHBLOCK}}, $self->{Arch};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines