[Collab-qa-commits] r942 - in udd/src: . udd
neronus-guest at alioth.debian.org
neronus-guest at alioth.debian.org
Sun Jul 27 11:38:36 UTC 2008
Author: neronus-guest
Date: 2008-07-27 11:38:35 +0000 (Sun, 27 Jul 2008)
New Revision: 942
Modified:
udd/src/test.yaml
udd/src/udd/bugs_gatherer.pl
Log:
Added bugs to dispatcher (bugs.debian.org that is)
Moved epoch to timestamp conversion from perl to postgresql
Modified: udd/src/test.yaml
===================================================================
--- udd/src/test.yaml 2008-07-26 19:47:58 UTC (rev 941)
+++ udd/src/test.yaml 2008-07-27 11:38:35 UTC (rev 942)
@@ -9,6 +9,7 @@
popcon: module udd.popcon_gatherer
testing-migrations: module udd.testing_migrations_gatherer
upload-history: module udd.upload_history_gatherer
+ bugs: exec DEBBUGS_CONFIG_FILE=/org/udd.debian.net/mirrors/bugs.debian.org/etc/config perl ./udd/bugs_gatherer.pl
#src-pkg: python sources_gatherer.py
debug: 1
@@ -135,3 +136,7 @@
type: upload-history
path: /tmp/upload-history
update-command: if [ ! -e /tmp/upload-history/ ]; then mkdir /tmp/upload-history/; fi; rm -rf /tmp/upload-history/*; wget -r --no-parent -nd -A debian-devel-* -P /tmp/upload-history http://qa.debian.org/~filippo/ddc/
+
+bugs:
+ type: bugs
+ update-command: /org/udd.debian.org/mirrors/sync-bugs.debian.org
Modified: udd/src/udd/bugs_gatherer.pl
===================================================================
--- udd/src/udd/bugs_gatherer.pl 2008-07-26 19:47:58 UTC (rev 941)
+++ udd/src/udd/bugs_gatherer.pl 2008-07-27 11:38:35 UTC (rev 942)
@@ -1,16 +1,16 @@
#!/usr/bin/perl
-# Last-Modified: <Sat Jul 26 13:26:22 2008>
+# Last-Modified: <Sun Jul 27 11:36:21 2008>
use strict;
use warnings;
-use lib qw{/org/udd.debian.net/mirrors/bugs.debian.org/perl};
+use lib qw{./ /org/udd.debian.net/mirrors/bugs.debian.org/perl};
use DBI;
use YAML::Syck;
use Debbugs::Bugs qw{get_bugs};
-use Debbugs::Status qw{readbug get_bug_status bug_presence};
+use Debbugs::Status qw{read_bug get_bug_status bug_presence};
use Debbugs::Packages qw{binarytosource getpkgsrc};
use POSIX qw{strftime};
@@ -55,12 +55,14 @@
# Read all bugs
foreach my $bug_nr (get_bugs()) {
+ #next unless $bug_nr =~ /0$/;
# Fetch bug using Debbugs
- my %bug = %{get_bug_status($bug_nr)};
+ # Yeah, great, why does get_bug_status not accept a location?
+ my %bug = %{get_bug_status(bug => $bug_nr, status => read_bug(bug => $bug_nr, location => 'db_h'))};
# Convert data where necessary
- my $date = strftime("%Y-%m-%d %T", localtime($bug{date}));
- my $log_modified = strftime("%Y-%m-%d %T", localtime($bug{log_modified}));
+ #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 pending);
my @found_versions = map { $dbh->quote($_) } @{$bug{found_versions}};
my @fixed_versions = map { $dbh->quote($_) } @{$bug{fixed_versions}};
@@ -108,9 +110,9 @@
# Insert data into bugs table
- my $query = "INSERT INTO bugs VALUES ($bug_nr, '$bug{package}', $source, '$date', \
+ my $query = "INSERT INTO bugs VALUES ($bug_nr, '$bug{package}', $source, $bug{date}::abstime, \
E$bug{pending}, '$bug{severity}', '$bug{keywords}', E$bug{originator}, E$bug{owner}, \
- E$bug{subject}, '$log_modified', $present_in_stable,
+ E$bug{subject}, $bug{log_modified}::abstime, $present_in_stable,
$present_in_testing, $present_in_unstable)";
# Execute insertion
my $sth = $dbh->prepare($query);
More information about the Collab-qa-commits
mailing list