[Debian-l10n-commits] r1121 - in /dl10n/trunk: Changelog lib/Debian/L10n/Spider.pm
nekral-guest at users.alioth.debian.org
nekral-guest at users.alioth.debian.org
Mon Aug 4 18:07:30 UTC 2008
Author: nekral-guest
Date: Mon Aug 4 18:07:30 2008
New Revision: 1121
URL: http://svn.debian.org/wsvn/?sc=1&rev=1121
Log:
* lib/Debian/L10n/Spider.pm: There has beenno issues so far with
the soap interface. Remove the support for the LDAP BTS interface.
Modified:
dl10n/trunk/Changelog
dl10n/trunk/lib/Debian/L10n/Spider.pm
Modified: dl10n/trunk/Changelog
URL: http://svn.debian.org/wsvn/dl10n/trunk/Changelog?rev=1121&op=diff
==============================================================================
--- dl10n/trunk/Changelog (original)
+++ dl10n/trunk/Changelog Mon Aug 4 18:07:30 2008
@@ -1,3 +1,8 @@
+2008-08-04 Nicolas François <nicolas.francois at centraliens.net>
+
+ * lib/Debian/L10n/Spider.pm: There has beenno issues so far with
+ the soap interface. Remove the support for the LDAP BTS interface.
+
2008-08-04 Nicolas François <nicolas.francois at centraliens.net>
* lib/Debian/L10n/Spider.pm: When a new cycle starts (after a
Modified: dl10n/trunk/lib/Debian/L10n/Spider.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/L10n/Spider.pm?rev=1121&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/L10n/Spider.pm (original)
+++ dl10n/trunk/lib/Debian/L10n/Spider.pm Mon Aug 4 18:07:30 2008
@@ -376,7 +376,6 @@
sub check_bts($) {
my $db = shift;
-# check_bts_ldap($db);
check_bts_soap($db);
}
@@ -482,140 +481,6 @@
}
}
}
-}
-
-sub check_bts_ldap($) {
- my $db = shift;
- my %seen;
- my %opendate;
- my %closedate;
- my %fixdate;
- my %bugsubmitter;
- my $ldap = Net::LDAP->new( 'bts2ldap.debian.net', 'port' => 10101 ) or die "Unable to connect to ldap: $!\n";
- $ldap->bind;
-
- foreach my $pkg (sort (grep { $db->has_status($_) } $db->list_packages())) {
- foreach my $statusline (@{$db->status($pkg)}) {
- my ($type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb) = @{$statusline};
- warn "$pkg\:$type\:$file does not specify the status\n"
- unless defined $status_from_db;
- next unless defined $status_from_db;
- next unless $bug_nb;
- next unless ($status_from_db eq 'bts')
- || ($status_from_db eq 'wontfix')
- || ($status_from_db eq 'fix');
- my $bugwontfix = 0;
-
- unless ($seen{$bug_nb}) {
- my $content;
-# if (-e '/org/bugs.debian.org/spool/db-h') {
-# my $file = sprintf "/org/bugs.debian.org/spool/db-h/%s/%d.log", substr($bug_nb, -2), $bug_nb;
-# my $log;
-# next unless (-e $file);
-# open FH, "<$file" or die "Cannot open $file: $!";
-# $log = join("",<FH>);
-# close FH;
-# $content = \$log;
-# } else {
- my $bugdone = 0;
- my $bugfixed = 0;
- my $ldap_bugs = $ldap->search( base => "dc=current,dc=bugs,dc=debian,dc=org" , filter => "debbugsID=$bug_nb");
- if ($ldap_bugs->count() == 0) {
- $db->add_status($pkg, $type, $file, "2000-01-01 00:00:00 +0000", "done", $translator, $list, $url, $bug_nb);
- next;
- }
- foreach my $entry ($ldap_bugs->entries) {
- my $pkg_bug = $entry->get_value( "debbugsPackage" );
- my $pkg_owner = parse_submitter($entry->get_value( "debbugsSubmitter" ));
- if ($pkg_bug ne $pkg) {
- print STDERR "Warning: #$bug_nb filled against $pkg_bug but $pkg is in the database\n";
- }
- $opendate{$bug_nb} = Date::Format::time2str("%Y-%m-%d %T %z", $entry->get_value( "debbugsDate" ), "GMT");
- $bugsubmitter{$bug_nb} = $pkg_owner;
- if (($entry->get_value( "debbugsState" ) eq "done") and (not (grep ( /^unstable$/, $entry->get_value("debbugsAffected")))) ) {
- $bugdone = 1;
- } else {
- my @attrvalues = $entry->get_value( "debbugsTag");
- $bugfixed = 1 if (grep ( /^fixed$/, @attrvalues));
- $bugwontfix = 1 if (grep ( /^wontfix$/, @attrvalues));
- }
- }
- if ($bugdone || $bugfixed) {
- {
- my $bts_url = "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=$bug_nb'}";
- my $answer = $Web_agent -> request(HTTP::Request -> new (GET => $bts_url));
- next unless $answer -> is_success;
- $content = $answer -> content_ref;
- next unless $$content;
- $seen{$bug_nb} = 1;
- }
-# FIXME: <\/a> is wrong?
- $$content =~ /(.*?)Message received<\/a> at (?:submit|maintonly)\@bugs\.debian\.org(.*)/ms;
-
- if ($bugdone) {
- my $v = $$content;
-# FIXME: <\/a> is wrong?
- $v = $1 while ($v =~ /Message received<\/a> at $bug_nb-(?:close|done)\@bugs\.debian\.org(.*)/ms);
- $v =~ /^<b>Date:<\/b> (.*)/m;
- $closedate{$bug_nb} = $1;
- $closedate{$bug_nb} = parse_date($closedate{$bug_nb} || $date);
- }
-
- if ($bugfixed) {
- my $v = $$content;
- $v = $1 while ($v =~ /Tags added: (?:.*?)\bfixed\b(.*)/ms); # search <hr>tags added<hr>
- $v =~ /<a href="([^"]*)">Full text/;
- $v = $Web_agent -> request(HTTP::Request -> new (GET => "http://bugs.debian.org/cgi-bin/$1"));
- if ($v -> is_success) {
- $v = ${$v->content_ref};
- $v =~ /^<pre (.*)/ms;
- $v = $1;
- $v =~ /^Date: (.*)/m;
- $fixdate{$bug_nb} = $1;
- }
- $fixdate{$bug_nb} = parse_date($fixdate{$bug_nb} || $date);
- }
- }
- }
-
- if ($closedate{$bug_nb}) {
- $date = $closedate{$bug_nb};
- if ($status_from_db ne 'done') {
- print "close #$bug_nb of $pkg (at $closedate{$bug_nb})\n";
- $status_from_db = 'done';
- }
- } elsif ($fixdate{$bug_nb}) {
- $date = $fixdate{$bug_nb};
- if ($status_from_db ne 'fix') {
- print "fix #$bug_nb of $pkg (at $fixdate{$bug_nb})\n";
- $status_from_db = 'fix';
- }
- } else {
- if ($opendate{$bug_nb} ne $date) {
- print "fix date of #$bug_nb of $pkg from $date to $opendate{$bug_nb}.\n";
- $date = $opendate{$bug_nb};
- }
- if ($bugwontfix) {
- if ($status_from_db ne 'wontfix') {
- print "wontfix #$bug_nb of $pkg\n";
- $status_from_db = 'wontfix';
- }
- }
- }
- if ($bugsubmitter{$bug_nb} ne $translator) {
- print "fix submitter of #$bug_nb of $pkg from $translator to $bugsubmitter{$bug_nb}.\n";
- $translator = $bugsubmitter{$bug_nb};
- }
- if ($status_from_db eq 'wontfix') {
- if (not $bugwontfix) {
- print "removing wontfix tag for #$bug_nb of $pkg\n";
- $status_from_db = 'bts';
- }
- }
- $db->add_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb);
- }
- }
- $ldap->unbind;
}
More information about the Debian-l10n-commits
mailing list