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; |
53 |
|
"", $self, |
54 |
|
\&Arch_End,$self); |
55 |
|
$self->{Arch}=1; |
56 |
< |
push @{$self->{ARCHBLOCK}}, $Arch; |
56 |
> |
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
57 |
|
|
58 |
|
} |
59 |
|
|
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 { |
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", |
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 |
|
} |
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}); |
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}; |