26 |
|
# store(location) : Save object to given file |
27 |
|
# restore(location) : Restore object from specified file |
28 |
|
# reset() : Clean out all the features |
29 |
+ |
# equals(toolobj) : return 1 if the tools correspond in url version etc. |
30 |
|
|
31 |
|
package BuildSystem::Tool; |
32 |
|
use Utilities::Verbose; |
61 |
|
:$self->{url}; |
62 |
|
} |
63 |
|
|
64 |
+ |
sub equals { |
65 |
+ |
my $self=shift; |
66 |
+ |
my $tool=shift; |
67 |
+ |
|
68 |
+ |
my $rv=0; |
69 |
+ |
if ( ($tool->url() eq $self->url() ) && |
70 |
+ |
($tool->name() eq $self->name() ) && |
71 |
+ |
($tool->version() eq $self->version()) ) { |
72 |
+ |
$rv=1; |
73 |
+ |
} |
74 |
+ |
return $rv; |
75 |
+ |
} |
76 |
+ |
|
77 |
|
sub listtype { |
78 |
|
my $self=shift; |
79 |
|
my $type=shift; |
216 |
|
$fh->open("<".$location) or die "Unable to open $location for output". |
217 |
|
$!."\n"; |
218 |
|
my ($tool,$type,$variable,$value); |
219 |
+ |
my @fields; |
220 |
|
while ( <$fh> ) { |
221 |
|
chomp; |
222 |
|
next if /^#/; |
223 |
|
next if /^\s*$/; |
224 |
< |
($variable, $value, $type)=split /:/; |
224 |
> |
@fields=split /:/; |
225 |
> |
if ( $_!~/:$/ ) { |
226 |
> |
$type=pop @fields; |
227 |
> |
} |
228 |
> |
else { $type="" }; |
229 |
> |
$variable=shift @fields; |
230 |
> |
$value=join ":",@fields; |
231 |
> |
#($variable, $value, $type)=split /:/; |
232 |
|
next if ( $variable=~/\&/ ); |
233 |
|
$product=~tr[A-Z][a-z]; |
234 |
|
if ( $type eq "_sys" ) { |
238 |
|
} |
239 |
|
else { |
240 |
|
$self->addfeature($variable,$value); |
241 |
+ |
if ( $type ne "" ) { |
242 |
+ |
$self->type($variable,$type); |
243 |
+ |
} |
244 |
|
} |
245 |
|
} |
246 |
|
undef $fh; |