Update of /cvsroot/compbench/compbenchmarks-web/tools
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3190
Modified Files:
compbenchmarks-import-file.pl
Log Message:
Duplicate results are now computed using (among other things) their index in entry files. Warns on bad syntax.
Index: compbenchmarks-import-file.pl
===================================================================
RCS file: /cvsroot/compbench/compbenchmarks-web/tools/compbenchmarks-import-file.pl,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** compbenchmarks-import-file.pl 4 Oct 2006 15:32:42 -0000 1.18
--- compbenchmarks-import-file.pl 10 Oct 2006 16:47:04 -0000 1.19
***************
*** 49,53 ****
sub cbmc_result_duplicate {
my $r = shift;
! my $str = "ts=$INDEX_TIMESTAMP\n";
my $cmd5;
foreach(keys %{$r}) {
--- 49,54 ----
sub cbmc_result_duplicate {
my $r = shift;
! my $idx = shift;
! my $str = "ts=$INDEX_TIMESTAMP\nidx=$idx\n";
my $cmd5;
foreach(keys %{$r}) {
***************
*** 63,66 ****
--- 64,68 ----
}
+ # Duplicated in compbenchmarks-import.pl
sub cbmc_file_parse {
my $filename = shift;
***************
*** 101,105 ****
print "\n";
}
! }
sub cbmc_object_import {
--- 103,107 ----
print "\n";
}
! }
sub cbmc_object_import {
***************
*** 211,214 ****
--- 213,217 ----
@objects=@index;
push(@objects, @results);
+ my $idx = 0;
my $o;
***************
*** 225,234 ****
my ($table, $check, $request) = cbmc_object_import($o);
my $exists = 0;
!
if ($type ne 'result') {
! $exists=sql_select_single($dbh, $table, "count(*)", "$check");
} else {
my $x;
! ($x, $result_id_insert_request)=cbmc_result_duplicate($o);
if ($x) {
$result_record_not_inserted++;
--- 228,245 ----
my ($table, $check, $request) = cbmc_object_import($o);
my $exists = 0;
! $idx++;
if ($type ne 'result') {
! if (!defined($check)) {
! $exists=1;
! cbmc_warning("Syntax/interpretation error :");
! foreach(keys %{$o}) {
! cbmc_warning(" ERROR / $_ -> $o->{$_}");
! }
! } else {
! $exists=sql_select_single($dbh, $table, "count(*)", "$check");
! }
} else {
my $x;
! ($x, $result_id_insert_request)=cbmc_result_duplicate($o, $idx);
if ($x) {
$result_record_not_inserted++;
***************
*** 271,275 ****
}
}
-
sql_disconnect($dbh);
}
--- 282,285 ----
|