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; |
33 |
|
require 5.004; |
34 |
+ |
@ISA=qw(Utilities::Verbose); |
35 |
|
|
36 |
|
sub new { |
37 |
|
my $class=shift; |
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; |
194 |
|
my $location=shift; |
195 |
|
|
196 |
|
my $fh=FileHandle->new(); |
197 |
+ |
$self->verbose("opening $location for output"); |
198 |
|
$fh->open(">".$location) or die "Unable to open $location for output". |
199 |
|
$!."\n"; |
200 |
|
print $fh "name:".$self->name().":_sys\n"; |