Author: neronus-guest
Date: 2008-07-23 10:33:26 +0000 (Wed, 23 Jul 2008)
New Revision: 920

Modified:
   udd/src/setup-db.sql
   udd/src/udd/bugs_gatherer.pl
Log:
Added fixed_in and found_in versions


Modified: udd/src/setup-db.sql
===================================================================
--- udd/src/setup-db.sql        2008-07-22 19:03:59 UTC (rev 919)
+++ udd/src/setup-db.sql        2008-07-23 10:33:26 UTC (rev 920)
@@ -35,6 +35,12 @@
 CREATE TABLE bug_user_tags
   (bug_user text, tag text, bug_nr text);
 
+CREATE TABLE bug_found_in
+  (id int, version text);
+
+CREATE TABLE bug_fixed_in
+  (id int, version text);
+
 CREATE VIEW popcon_average AS
   SELECT sources.package, avg(vote) AS vote, avg(olde) AS old, avg(recent) AS 
recent, avg(nofiles) as nofiles
     FROM sources, popcon,

Modified: udd/src/udd/bugs_gatherer.pl
===================================================================
--- udd/src/udd/bugs_gatherer.pl        2008-07-22 19:03:59 UTC (rev 919)
+++ udd/src/udd/bugs_gatherer.pl        2008-07-23 10:33:26 UTC (rev 920)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# Last-Modified: <Tue Jul 22 18:44:19 2008>
+# Last-Modified: <Wed Jul 23 10:02:51 2008>
 
 use strict;
 use warnings;
@@ -32,6 +32,8 @@
        $dbh->{AutoCommit} = 0;
 
        $dbh->prepare("DELETE FROM bugs")->execute();
+       $dbh->prepare("DELETE from bug_found_in")->execute();
+       $dbh->prepare("DELETE from bug_fixed_in")->execute();
 
        # Read all bugs
        foreach my $bug_nr (get_bugs()) {
@@ -40,12 +42,26 @@
                my $date = strftime("%Y-%m-%d %T", localtime($bug{date}));
                my $log_modified = strftime("%Y-%m-%d %T", 
localtime($bug{log_modified}));
                map { $bug{$_} = $dbh->quote($bug{$_}) } qw(subject originator 
owner);
+               my @found_versions = map { $dbh->quote($_) } 
@{$bug{found_versions}};
+               my @fixed_versions = map { $dbh->quote($_) } 
@{$bug{fixed_versions}};
+
+               # Insert data into bugs table
                my $query = "INSERT INTO bugs VALUES ($bug_nr, '$bug{package}', 
'$date', \
                             NULL, '$bug{severity}', '$bug{keywords}', 
$bug{originator}, $bug{owner}, \
                                         $bug{subject}, '$log_modified')";
                # Execute insertion
                my $sth = $dbh->prepare($query);
                $sth->execute() or die $!;
+
+               # insert data into bug_fixed_in and bug_found_in tables
+               foreach my $version (@found_versions) {
+                       $query = "INSERT INTO bug_found_in VALUES ($bug_nr, 
$version)";
+                       $dbh->prepare($query)->execute() or die $!;
+               }
+               foreach my $version (@fixed_versions) {
+                       $query = "INSERT INTO bug_fixed_in VALUES ($bug_nr, 
$version)";
+                       $dbh->prepare($query)->execute() or die $!;
+               }
        }
 
        $dbh->commit();


_______________________________________________
Collab-qa-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/collab-qa-commits

Reply via email to