1 |
sashby |
1.2 |
#____________________________________________________________________
|
2 |
|
|
# File: ToolManager.pm
|
3 |
|
|
#____________________________________________________________________
|
4 |
|
|
#
|
5 |
|
|
# Author: Shaun Ashby <Shaun.Ashby@cern.ch>
|
6 |
|
|
# Copyright: 2003 (C) Shaun Ashby
|
7 |
|
|
#
|
8 |
|
|
#--------------------------------------------------------------------
|
9 |
|
|
package BuildSystem::ToolManager;
|
10 |
|
|
require 5.004;
|
11 |
|
|
|
12 |
|
|
use Exporter;
|
13 |
|
|
use BuildSystem::ToolCache;
|
14 |
|
|
use BuildSystem::ToolParser;
|
15 |
|
|
use Utilities::AddDir;
|
16 |
|
|
use Utilities::Verbose;
|
17 |
muzaffar |
1.19 |
use SCRAM::MsgLog;
|
18 |
sashby |
1.2 |
|
19 |
|
|
@ISA=qw(BuildSystem::ToolCache Utilities::Verbose);
|
20 |
|
|
@EXPORT_OK=qw( );
|
21 |
|
|
#
|
22 |
sashby |
1.9 |
|
23 |
sashby |
1.2 |
sub new
|
24 |
|
|
{
|
25 |
|
|
my $proto=shift;
|
26 |
|
|
my $class=ref($proto) || $proto;
|
27 |
|
|
my $self=$class->SUPER::new(); # Inherit from ToolCache
|
28 |
|
|
bless $self,$class;
|
29 |
muzaffar |
1.20 |
$self->init (shift);
|
30 |
sashby |
1.2 |
return $self;
|
31 |
|
|
}
|
32 |
|
|
|
33 |
muzaffar |
1.20 |
sub init ()
|
34 |
sashby |
1.2 |
{
|
35 |
|
|
my $self=shift;
|
36 |
|
|
my $projectarea=shift;
|
37 |
|
|
$self->{topdir}=$projectarea->location();
|
38 |
|
|
$self->{configdir}=$self->{topdir}."/".$projectarea->configurationdir();
|
39 |
muzaffar |
1.20 |
$self->{archstore}=$projectarea->archdir();
|
40 |
muzaffar |
1.21 |
$self->{toolcache}=$self->{configdir}."/toolbox/$ENV{SCRAM_ARCH}/tools";
|
41 |
sashby |
1.2 |
$self->name($projectarea->toolcachename());
|
42 |
muzaffar |
1.20 |
$self->dirty();
|
43 |
sashby |
1.2 |
}
|
44 |
muzaffar |
1.20 |
|
45 |
sashby |
1.2 |
sub setupalltools()
|
46 |
|
|
{
|
47 |
|
|
my $self = shift;
|
48 |
muzaffar |
1.20 |
my @selected=();
|
49 |
|
|
my $tooldir=$self->{toolcache}."/selected";
|
50 |
|
|
foreach my $tool (@{&getfileslist($tooldir)})
|
51 |
sashby |
1.2 |
{
|
52 |
muzaffar |
1.20 |
if ($tool=~/^(.+)\.xml$/) {push @selected,$1;}
|
53 |
sashby |
1.2 |
}
|
54 |
muzaffar |
1.20 |
foreach my $tool (@selected){$self->coresetup("${tooldir}/${tool}.xml");}
|
55 |
muzaffar |
1.19 |
scramlogmsg("\n");
|
56 |
sashby |
1.2 |
}
|
57 |
|
|
|
58 |
|
|
sub coresetup()
|
59 |
|
|
{
|
60 |
|
|
my $self=shift;
|
61 |
muzaffar |
1.20 |
my ($toolfile) = @_;
|
62 |
sashby |
1.2 |
|
63 |
muzaffar |
1.20 |
my $toolparser = BuildSystem::ToolParser->new();
|
64 |
|
|
$toolparser->filehead('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><doc type="BuildSystem::ToolDoc" version="1.0">');
|
65 |
|
|
$toolparser->filetail('</doc>');
|
66 |
|
|
$toolparser->parse($toolfile);
|
67 |
|
|
my $toolname = $toolparser->toolname();
|
68 |
|
|
my $toolversion = $toolparser->toolversion();
|
69 |
muzaffar |
1.19 |
scramlogmsg("\n",$::bold."Setting up ",$toolname," version ",$toolversion,": ".$::normal,"\n");
|
70 |
sashby |
1.2 |
|
71 |
|
|
# Next, set up the tool:
|
72 |
muzaffar |
1.20 |
my $store = $toolparser->processrawtool();
|
73 |
sashby |
1.8 |
|
74 |
|
|
# Check to see if this tool is a compiler. If so, store it.
|
75 |
|
|
# Also store the language that this compiler supprots, and a
|
76 |
|
|
# compiler name (e.g. gcc323) which, in conjunction with a stem
|
77 |
|
|
# architecture name like slc3_ia32_, can be used to build a complete arch string:
|
78 |
|
|
if ($store->scram_compiler() == 1)
|
79 |
|
|
{
|
80 |
|
|
my @supported_language = $store->flags("SCRAM_LANGUAGE_TYPE");
|
81 |
|
|
my @compilername = $store->flags("SCRAM_COMPILER_NAME");
|
82 |
|
|
$self->scram_compiler($supported_language[0],$toolname,$compilername[0]);
|
83 |
|
|
}
|
84 |
|
|
|
85 |
sashby |
1.16 |
# Store the ToolData object in the cache:
|
86 |
muzaffar |
1.20 |
$self->storeincache($toolname,$store);
|
87 |
|
|
my $srcfile=Utilities::AddDir::fixpath($toolfile);
|
88 |
|
|
my $desfile=Utilities::AddDir::fixpath($self->{toolcache}."/selected/${toolname}.xml");
|
89 |
|
|
use File::Copy;
|
90 |
|
|
if ($srcfile ne $desfile)
|
91 |
|
|
{
|
92 |
|
|
use File::Copy;
|
93 |
|
|
my $desfile1=Utilities::AddDir::fixpath($self->{toolcache}."/available/${toolname}.xml");
|
94 |
|
|
if ($srcfile ne $desfile1)
|
95 |
|
|
{
|
96 |
|
|
copy($srcfile,$desfile1);
|
97 |
sashby |
1.2 |
}
|
98 |
muzaffar |
1.20 |
if (-e $desfile) { unlink($desfile);}
|
99 |
|
|
symlink("../available/${toolname}.xml",$desfile);
|
100 |
sashby |
1.2 |
}
|
101 |
muzaffar |
1.20 |
scramlogclean();
|
102 |
sashby |
1.2 |
return $self;
|
103 |
|
|
}
|
104 |
|
|
|
105 |
|
|
sub setupself()
|
106 |
|
|
{
|
107 |
|
|
my $self=shift;
|
108 |
|
|
# Process the file "Self" in local config directory. This is used to
|
109 |
|
|
# set all the paths/runtime settings for this project:
|
110 |
muzaffar |
1.20 |
my $filename=$self->{configdir}."/Self.xml";
|
111 |
sashby |
1.16 |
|
112 |
sashby |
1.2 |
if ( -f $filename )
|
113 |
|
|
{
|
114 |
muzaffar |
1.19 |
scramlogmsg("\n",$::bold."Setting up SELF:".$::normal,"\n");
|
115 |
sashby |
1.2 |
# Self file exists so process it:
|
116 |
|
|
$selfparser = BuildSystem::ToolParser->new();
|
117 |
muzaffar |
1.18 |
$selfparser->filehead ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><doc type="BuildSystem::ToolDoc" version="1.0">');
|
118 |
|
|
$selfparser->filehead ('</doc>');
|
119 |
muzaffar |
1.20 |
$selfparser->parse($filename);
|
120 |
sashby |
1.2 |
|
121 |
|
|
# Next, set up the tool:
|
122 |
muzaffar |
1.20 |
$store = $selfparser->processrawtool();
|
123 |
muzaffar |
1.19 |
|
124 |
sashby |
1.2 |
# If we are in a developer area, also add RELEASETOP paths:
|
125 |
|
|
if (exists($ENV{RELEASETOP}))
|
126 |
|
|
{
|
127 |
|
|
print "\nAdding RELEASE area settings to self....OK","\n", if ($ENV{SCRAM_DEBUG});
|
128 |
|
|
$store->addreleasetoself();
|
129 |
|
|
}
|
130 |
|
|
|
131 |
|
|
# Store the ToolData object in the cache:
|
132 |
|
|
$self->storeincache($selfparser->toolname(),$store);
|
133 |
muzaffar |
1.19 |
scramlogmsg("\n");
|
134 |
sashby |
1.2 |
}
|
135 |
|
|
else
|
136 |
|
|
{
|
137 |
muzaffar |
1.19 |
scramlogdump();
|
138 |
sashby |
1.2 |
print "\n";
|
139 |
sashby |
1.16 |
print "SCRAM: No file config/Self.xml...nothing to do.";
|
140 |
sashby |
1.2 |
print "\n";
|
141 |
|
|
return;
|
142 |
|
|
}
|
143 |
|
|
}
|
144 |
|
|
|
145 |
muzaffar |
1.20 |
sub update()
|
146 |
sashby |
1.2 |
{
|
147 |
muzaffar |
1.20 |
my $self=shift;
|
148 |
|
|
my $area=shift;
|
149 |
|
|
$self->init($area);
|
150 |
|
|
$self->setupself();
|
151 |
|
|
$self->dirty ()
|
152 |
sashby |
1.2 |
}
|
153 |
muzaffar |
1.20 |
|
154 |
sashby |
1.2 |
sub storeincache()
|
155 |
|
|
{
|
156 |
|
|
my $self=shift;
|
157 |
|
|
my ($toolname,$dataobject)=@_;
|
158 |
|
|
|
159 |
|
|
# Store ToolData object (for a set-up tool) in cache:
|
160 |
|
|
if (ref($dataobject) eq 'BuildSystem::ToolData')
|
161 |
|
|
{
|
162 |
sashby |
1.16 |
$self->updatetooltimestamp($dataobject, $toolname);
|
163 |
muzaffar |
1.20 |
delete $self->{SETUP}->{$toolname};
|
164 |
sashby |
1.2 |
$self->{SETUP}->{$toolname} = $dataobject;
|
165 |
|
|
}
|
166 |
|
|
else
|
167 |
|
|
{
|
168 |
|
|
$::scram->scramerror("ToolManager: BuildSystem::ToolData object reference expected.")
|
169 |
|
|
}
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
sub tools()
|
173 |
|
|
{
|
174 |
|
|
my $self = shift;
|
175 |
|
|
my @tools;
|
176 |
|
|
|
177 |
|
|
map
|
178 |
|
|
{
|
179 |
|
|
if ($_ ne "self")
|
180 |
|
|
{
|
181 |
|
|
push(@tools, $_);
|
182 |
|
|
}
|
183 |
|
|
} keys %{$self->{SETUP}};
|
184 |
|
|
|
185 |
|
|
# Return list of set-up tools:
|
186 |
|
|
return @tools;
|
187 |
|
|
}
|
188 |
|
|
|
189 |
|
|
sub toolsdata()
|
190 |
|
|
{
|
191 |
|
|
my $self = shift;
|
192 |
|
|
my $tooldata = [];
|
193 |
muzaffar |
1.20 |
$self->{internal}{donetools}={};
|
194 |
|
|
$self->{internal}{scram_tools}={};
|
195 |
|
|
foreach my $tool (sort keys %{$self->{SETUP}})
|
196 |
sashby |
1.2 |
{
|
197 |
muzaffar |
1.20 |
if ($self->{SETUP}{$tool}->scram_project()) {$self->{internal}{scram_tools}{$tool}=1;}
|
198 |
|
|
elsif ($tool ne "self")
|
199 |
sashby |
1.2 |
{
|
200 |
muzaffar |
1.20 |
$self->_toolsdata($tool,$tooldata);
|
201 |
|
|
}
|
202 |
|
|
}
|
203 |
|
|
foreach my $tool (keys %{$self->{internal}{scram_tools}})
|
204 |
|
|
{
|
205 |
|
|
$self->_toolsdata_scram($tool,$tooldata);
|
206 |
|
|
}
|
207 |
|
|
delete $self->{internal}{donetools};
|
208 |
|
|
delete $self->{internal}{scram_tools};
|
209 |
|
|
my $data=[];
|
210 |
|
|
foreach my $d (@$tooldata)
|
211 |
|
|
{
|
212 |
|
|
if (ref($d) eq "ARRAY")
|
213 |
|
|
{
|
214 |
|
|
foreach my $t (@$d) {push @$data,$t;}
|
215 |
|
|
}
|
216 |
|
|
}
|
217 |
|
|
return $data;
|
218 |
|
|
}
|
219 |
|
|
|
220 |
|
|
sub _toolsdata()
|
221 |
|
|
{
|
222 |
|
|
my $self = shift;
|
223 |
|
|
my $tool=shift;
|
224 |
|
|
my $data=shift || [];
|
225 |
|
|
my $order=-1;
|
226 |
|
|
if(exists $self->{internal}{donetools}{$tool}){return $self->{internal}{donetools}{$tool};}
|
227 |
|
|
$self->{internal}{donetools}{$tool}=$order;
|
228 |
|
|
if (exists $self->{SETUP}{$tool})
|
229 |
|
|
{
|
230 |
|
|
if (exists $self->{SETUP}{$tool}{USE})
|
231 |
|
|
{
|
232 |
|
|
foreach my $use (@{$self->{SETUP}{$tool}{USE}})
|
233 |
sashby |
1.2 |
{
|
234 |
muzaffar |
1.20 |
my $o=$self->_toolsdata(lc($use),$data);
|
235 |
|
|
if ($o>$order){$order=$o;}
|
236 |
sashby |
1.2 |
}
|
237 |
|
|
}
|
238 |
muzaffar |
1.20 |
$order++;
|
239 |
|
|
if(!defined $data->[$order]){$data->[$order]=[];}
|
240 |
|
|
push @{$data->[$order]},$self->{SETUP}{$tool};
|
241 |
|
|
$self->{internal}{donetools}{$tool}=$order;
|
242 |
sashby |
1.2 |
}
|
243 |
muzaffar |
1.20 |
return $order;
|
244 |
sashby |
1.2 |
}
|
245 |
|
|
|
246 |
muzaffar |
1.20 |
sub _toolsdata_scram()
|
247 |
sashby |
1.2 |
{
|
248 |
muzaffar |
1.20 |
my $self = shift;
|
249 |
|
|
my $tool=shift;
|
250 |
|
|
my $data=shift || [];
|
251 |
|
|
my $order=-1;
|
252 |
|
|
if(exists $self->{internal}{donetools}{$tool}){return $self->{internal}{donetools}{$tool};}
|
253 |
|
|
$self->{internal}{donetools}{$tool}=$order;
|
254 |
|
|
if(!exists $self->{internal}{scram_tools}{$tool}){return $order;}
|
255 |
|
|
use Configuration::ConfigArea;
|
256 |
|
|
use Cache::CacheUtilities;
|
257 |
|
|
my $cache=uc($tool)."_BASE";
|
258 |
|
|
$cache=$self->{SETUP}{$tool}{$cache};
|
259 |
|
|
if (!-d $cache)
|
260 |
|
|
{
|
261 |
|
|
print "ERROR: Release area \"$cache\" for \"$tool\" is not available.\n";
|
262 |
|
|
return $order;
|
263 |
|
|
}
|
264 |
|
|
my $area=Configuration::ConfigArea->new();
|
265 |
|
|
$area->location($cache);
|
266 |
|
|
my $cachefile=$area->toolcachename();
|
267 |
|
|
if (!-f $cachefile)
|
268 |
|
|
{
|
269 |
|
|
print "ERROR: Tools cache file for release area \"$cache\" is not available.\n";
|
270 |
|
|
return $order;
|
271 |
|
|
}
|
272 |
|
|
$cache=&Cache::CacheUtilities::read($cachefile);
|
273 |
|
|
my $tools=$cache->setup();
|
274 |
|
|
$order=scalar(@$data)-1;
|
275 |
|
|
foreach my $use (keys %$tools)
|
276 |
|
|
{
|
277 |
|
|
if ($tools->{$use}->scram_project() == 1)
|
278 |
|
|
{
|
279 |
|
|
my $o=$self->_toolsdata_scram($use,$data);
|
280 |
|
|
if ($o>$order){$order=$o;}
|
281 |
|
|
}
|
282 |
|
|
}
|
283 |
|
|
$order++;
|
284 |
|
|
if(!defined $data->[$order]){$data->[$order]=[];}
|
285 |
|
|
push @{$data->[$order]},$self->{SETUP}{$tool};
|
286 |
|
|
$self->{internal}{donetools}{$tool}=$order;
|
287 |
|
|
return $order;
|
288 |
|
|
}
|
289 |
sashby |
1.2 |
|
290 |
|
|
sub checkifsetup()
|
291 |
|
|
{
|
292 |
|
|
my $self=shift;
|
293 |
|
|
my ($tool)=@_;
|
294 |
|
|
# Return the ToolData object if the tool has been set up:
|
295 |
|
|
(exists $self->{SETUP}->{$tool}) ? return ($self->{SETUP}->{$tool})
|
296 |
|
|
: return undef;
|
297 |
|
|
}
|
298 |
|
|
|
299 |
|
|
sub remove_tool()
|
300 |
|
|
{
|
301 |
|
|
my $self=shift;
|
302 |
|
|
my ($toolname)=@_;
|
303 |
muzaffar |
1.20 |
my $tool = $self->{SETUP}{$toolname};
|
304 |
|
|
if ($tool->scram_compiler() == 1)
|
305 |
sashby |
1.2 |
{
|
306 |
muzaffar |
1.20 |
while (my ($langtype, $ctool) = each %{$self->{SCRAM_COMPILER}})
|
307 |
|
|
{
|
308 |
|
|
if ($toolname eq $ctool->[0]){delete $self->{SCRAM_COMPILER}->{$langtype};}
|
309 |
sashby |
1.2 |
}
|
310 |
|
|
}
|
311 |
muzaffar |
1.20 |
delete $self->{SETUP}{$toolname};
|
312 |
|
|
print "Deleting $toolname from cache.","\n";
|
313 |
|
|
$self->updatetooltimestamp (undef, $toolname);
|
314 |
sashby |
1.2 |
$self->writecache();
|
315 |
muzaffar |
1.20 |
my $file1=$self->{toolcache}."/selected/${toolname}.xml";
|
316 |
|
|
my $file2=$self->{toolcache}."/available/${toolname}.xml";
|
317 |
|
|
if ((!-f $file2) && (-f $file1))
|
318 |
|
|
{
|
319 |
|
|
use File::Copy;
|
320 |
|
|
copy ($file1,$file2);
|
321 |
|
|
}
|
322 |
|
|
unlink ($file1);
|
323 |
sashby |
1.2 |
}
|
324 |
|
|
|
325 |
|
|
sub scram_projects()
|
326 |
|
|
{
|
327 |
|
|
my $self=shift;
|
328 |
|
|
my $scram_projects={};
|
329 |
|
|
|
330 |
|
|
foreach my $t ($self->tools())
|
331 |
|
|
{
|
332 |
|
|
# Get the ToolData object:
|
333 |
|
|
my $td=$self->{SETUP}->{$t};
|
334 |
|
|
$scram_projects->{$t}=$td->variable_data(uc($t)."_BASE"), if ($td->scram_project());
|
335 |
|
|
}
|
336 |
|
|
|
337 |
|
|
return $scram_projects;
|
338 |
|
|
}
|
339 |
|
|
|
340 |
sashby |
1.8 |
sub scram_compiler()
|
341 |
|
|
{
|
342 |
|
|
my $self=shift;
|
343 |
|
|
my ($langtype, $toolname, $compilername)=@_;
|
344 |
|
|
|
345 |
|
|
if ($langtype)
|
346 |
|
|
{
|
347 |
|
|
# Store the compiler info according to supported
|
348 |
|
|
# language types.
|
349 |
|
|
#
|
350 |
|
|
# ---------------------- e.g C++ cxxcompiler gcc323
|
351 |
|
|
$self->{SCRAM_COMPILER}->{$langtype}=[ $toolname, $compilername ];
|
352 |
|
|
}
|
353 |
|
|
else
|
354 |
|
|
{
|
355 |
|
|
return $self->{SCRAM_COMPILER};
|
356 |
|
|
}
|
357 |
|
|
}
|
358 |
|
|
|
359 |
sashby |
1.16 |
sub updatetooltimestamp ()
|
360 |
|
|
{
|
361 |
|
|
my $self=shift;
|
362 |
|
|
my $obj=shift;
|
363 |
|
|
my $toolname=shift;
|
364 |
|
|
my $samevalues=0;
|
365 |
muzaffar |
1.18 |
my $stampdir = $self->{archstore}."/timestamps";
|
366 |
|
|
my $stampfile="${stampdir}/${toolname}";
|
367 |
sashby |
1.16 |
if (exists $self->{SETUP}->{$toolname})
|
368 |
|
|
{
|
369 |
|
|
$samevalues=$self->comparetoolsdata($self->{SETUP}->{$toolname},$obj);
|
370 |
|
|
}
|
371 |
muzaffar |
1.20 |
if ($toolname ne "self")
|
372 |
|
|
{
|
373 |
|
|
my $instdir = $self->{archstore}."/InstalledTools";
|
374 |
|
|
my $tfile = "${instdir}/${toolname}";
|
375 |
|
|
if ((!defined $obj) && (-f $tfile)) {unlink $tfile;}
|
376 |
|
|
elsif ((defined $obj) && (!-f $tfile))
|
377 |
|
|
{
|
378 |
|
|
Utilities::AddDir::adddir($instdir);
|
379 |
|
|
my $ref;
|
380 |
|
|
open($ref,">$tfile");
|
381 |
|
|
close($ref);
|
382 |
|
|
}
|
383 |
|
|
}
|
384 |
muzaffar |
1.18 |
if ((!$samevalues) || (!-f $stampfile))
|
385 |
sashby |
1.16 |
{
|
386 |
muzaffar |
1.18 |
if (!-d $stampdir)
|
387 |
sashby |
1.16 |
{
|
388 |
muzaffar |
1.20 |
Utilities::AddDir::adddir($stampdir);
|
389 |
sashby |
1.16 |
}
|
390 |
muzaffar |
1.20 |
my $ref;
|
391 |
|
|
open($ref,">$stampfile");
|
392 |
|
|
close($ref);
|
393 |
|
|
if (!$samevalues){$self->dirty();}
|
394 |
sashby |
1.16 |
}
|
395 |
|
|
}
|
396 |
|
|
|
397 |
|
|
sub comparetoolsdata ()
|
398 |
|
|
{
|
399 |
|
|
my $self=shift;
|
400 |
|
|
my $data1=shift || ();
|
401 |
|
|
my $data2=shift || ();
|
402 |
|
|
|
403 |
|
|
my $ref1=ref($data1);
|
404 |
|
|
my $ref2=ref($data2);
|
405 |
|
|
|
406 |
|
|
if ($ref1 ne $ref2)
|
407 |
|
|
{
|
408 |
|
|
return 0;
|
409 |
|
|
}
|
410 |
|
|
elsif ($ref1 eq "CODE")
|
411 |
|
|
{
|
412 |
|
|
return 1;
|
413 |
|
|
}
|
414 |
|
|
elsif(($ref1 eq "SCALAR") || ($ref1 eq ""))
|
415 |
|
|
{
|
416 |
|
|
if ($data1 eq $data2)
|
417 |
|
|
{
|
418 |
|
|
return 1;
|
419 |
|
|
}
|
420 |
|
|
return 0;
|
421 |
|
|
}
|
422 |
|
|
elsif ($ref1 eq "ARRAY")
|
423 |
|
|
{
|
424 |
|
|
my $count = scalar(@$data1);
|
425 |
|
|
if ($count != scalar(@$data2))
|
426 |
|
|
{
|
427 |
|
|
return 0;
|
428 |
|
|
}
|
429 |
|
|
for (my $i=0; $i<$count; $i++)
|
430 |
|
|
{
|
431 |
|
|
if (! $self->comparetoolsdata($data1->[$i],$data2->[$i]))
|
432 |
|
|
{
|
433 |
|
|
return 0;
|
434 |
|
|
}
|
435 |
|
|
}
|
436 |
|
|
return 1;
|
437 |
|
|
}
|
438 |
|
|
else
|
439 |
|
|
{
|
440 |
|
|
foreach my $k (keys %{$data1})
|
441 |
|
|
{
|
442 |
|
|
if (! exists $data2->{$k})
|
443 |
|
|
{
|
444 |
|
|
return 0;
|
445 |
|
|
}
|
446 |
|
|
}
|
447 |
|
|
foreach my $k (keys %{$data2})
|
448 |
|
|
{
|
449 |
|
|
if (! exists $data1->{$k})
|
450 |
|
|
{
|
451 |
|
|
return 0;
|
452 |
|
|
}
|
453 |
|
|
}
|
454 |
|
|
foreach my $k (keys %{$data2})
|
455 |
|
|
{
|
456 |
|
|
if (! $self->comparetoolsdata($data1->{$k},$data2->{$k}))
|
457 |
|
|
{
|
458 |
|
|
return 0;
|
459 |
|
|
}
|
460 |
|
|
}
|
461 |
|
|
return 1;
|
462 |
|
|
}
|
463 |
|
|
}
|
464 |
|
|
|
465 |
sashby |
1.2 |
1;
|