Author: neronus-guest
Date: 2008-07-23 14:32:10 +0000 (Wed, 23 Jul 2008)
New Revision: 922

Modified:
   udd/src/setup-db.sql
   udd/src/udd/bugs_gatherer.pl
Log:
Added affects_* to bugs table


Modified: udd/src/setup-db.sql
===================================================================
--- udd/src/setup-db.sql        2008-07-23 12:09:04 UTC (rev 921)
+++ udd/src/setup-db.sql        2008-07-23 14:32:10 UTC (rev 922)
@@ -27,7 +27,8 @@
 CREATE TABLE bugs
   (id int, package text, arrival timestamp, status text,
      severity text, tags text, submitter text, owner text, title text,
-     last_modified timestamp, UNIQUE (id));
+     last_modified timestamp, affects_stable boolean,
+    affects_testings boolean, affects_unstable boolean, UNIQUE (id));
 
 CREATE TABLE bug_merged_with
   (bug int, merged_with int);

Modified: udd/src/udd/bugs_gatherer.pl
===================================================================
--- udd/src/udd/bugs_gatherer.pl        2008-07-23 12:09:04 UTC (rev 921)
+++ udd/src/udd/bugs_gatherer.pl        2008-07-23 14:32:10 UTC (rev 922)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# Last-Modified: <Wed Jul 23 11:21:47 2008>
+# Last-Modified: <Wed Jul 23 14:26:55 2008>
 
 use strict;
 use warnings;
@@ -10,7 +10,7 @@
 use YAML::Syck;
 
 use Debbugs::Bugs qw{get_bugs};
-use Debbugs::Status qw{readbug get_bug_status};
+use Debbugs::Status qw{readbug get_bug_status bug_presence};
 
 use POSIX qw{strftime};
 
@@ -46,10 +46,40 @@
                my @found_versions = map { $dbh->quote($_) } 
@{$bug{found_versions}};
                my @fixed_versions = map { $dbh->quote($_) } 
@{$bug{fixed_versions}};
 
+               #Calculate bug presence in distributions
+               my $present_in_stable =
+                       bug_presence(bug => $bug_nr, status => \%bug,
+                                        dist => 'stable');
+               my $present_in_testing =
+                       bug_presence(bug => $bug_nr, status => \%bug,
+                                        dist => 'testing');
+               my $present_in_unstable =
+                       bug_presence(bug => $bug_nr, status => \%bug,
+                                        dist => 'unstable');
+               if(!defined($present_in_stable) or 
!defined($present_in_unstable) or !defined($present_in_testing)) {
+                       print "NUMBER: $bug_nr\n";
+               }
+               if(defined($present_in_stable) and ($present_in_stable eq 
'absent' or $present_in_stable eq 'fixed')) {
+                       $present_in_stable = 'FALSE';
+               } else {
+                       $present_in_stable = 'TRUE';
+               }
+               if(defined($present_in_testing) and ($present_in_testing eq 
'absent' or $present_in_testing eq 'fixed')) {
+                       $present_in_testing = 'FALSE';
+               } else {
+                       $present_in_testing = 'TRUE';
+               }
+               if(defined($present_in_unstable) and ($present_in_unstable eq 
'absent' or $present_in_unstable eq 'fixed')) {
+                       $present_in_unstable = 'FALSE';
+               } else {
+                       $present_in_unstable = 'TRUE';
+               }
+
                # 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')";
+                                        $bug{subject}, '$log_modified', 
$present_in_stable,
+                                        $present_in_testing, 
$present_in_unstable)";
                # Execute insertion
                my $sth = $dbh->prepare($query);
                $sth->execute() or die $!;


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

Reply via email to