Print this page
11972 resync smatch
   1 #!/usr/bin/perl -w
   2 
   3 use strict;
   4 use DBI;
   5 
   6 my $project = shift;
   7 my $warns = shift;
   8 my $db_file = shift;
   9 
  10 if (!defined($warns)) {
  11     print "usage:  $0 <-p=project> <smatch_warns.txt> <db_file>\n";
  12     exit(1);
  13 }
  14 
  15 my $db = DBI->connect("dbi:SQLite:$db_file", "", "", {AutoCommit => 0});
  16 $db->do("PRAGMA cache_size = 800000");
  17 $db->do("PRAGMA journal_mode = OFF");
  18 $db->do("PRAGMA count_changes = OFF");
  19 $db->do("PRAGMA temp_store = MEMORY");
  20 $db->do("PRAGMA locking = EXCLUSIVE");
  21 
  22 my ($dummy, $sql);
  23 
  24 open(WARNS, "<$warns");
  25 while (<WARNS>) {
  26 
  27     if (!($_ =~ /^.*? [^ ]*\(\) SQL: /)) {
  28         next;
  29     }
  30     ($dummy, $dummy, $sql) = split(/:/, $_, 3);
   1 #!/usr/bin/perl -w
   2 
   3 use strict;
   4 use DBI;
   5 
   6 my $project = shift;
   7 my $warns = shift;
   8 my $db_file = shift;
   9 
  10 if (!defined($db_file)) {
  11     print "usage:  $0 <-p=project> <smatch_warns.txt> <db_file>\n";
  12     exit(1);
  13 }
  14 
  15 my $db = DBI->connect("dbi:SQLite:$db_file", "", "", {AutoCommit => 0});
  16 $db->do("PRAGMA cache_size = 800000");
  17 $db->do("PRAGMA journal_mode = OFF");
  18 $db->do("PRAGMA count_changes = OFF");
  19 $db->do("PRAGMA temp_store = MEMORY");
  20 $db->do("PRAGMA locking = EXCLUSIVE");
  21 
  22 my ($dummy, $sql);
  23 
  24 open(WARNS, "<$warns");
  25 while (<WARNS>) {
  26 
  27     if (!($_ =~ /^.*? [^ ]*\(\) SQL: /)) {
  28         next;
  29     }
  30     ($dummy, $dummy, $sql) = split(/:/, $_, 3);