[Debian-l10n-commits] r1123 - 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:12:45 UTC 2008


Author: nekral-guest
Date: Mon Aug  4 18:12:44 2008
New Revision: 1123

URL: http://svn.debian.org/wsvn/?sc=1&rev=1123
Log:
	* lib/Debian/L10n/Spider.pm: Split check_bts_soap() into
	check_bts_soap() and check_bts_bug_soap(). The later permits to
	check the status of a single bug.

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=1123&op=diff
==============================================================================
--- dl10n/trunk/Changelog (original)
+++ dl10n/trunk/Changelog Mon Aug  4 18:12:44 2008
@@ -1,3 +1,9 @@
+2008-08-04  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* lib/Debian/L10n/Spider.pm: Split check_bts_soap() into
+	check_bts_soap() and check_bts_bug_soap(). The later permits to
+	check the status of a single bug.
+
 2008-08-04  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* lib/Debian/L10n/Spider.pm: After looking at the BTS, only update

Modified: dl10n/trunk/lib/Debian/L10n/Spider.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/L10n/Spider.pm?rev=1123&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/L10n/Spider.pm (original)
+++ dl10n/trunk/lib/Debian/L10n/Spider.pm Mon Aug  4 18:12:44 2008
@@ -379,12 +379,12 @@
 	check_bts_soap($db);
 }
 
+my %seen;
+my %opendate;
+my %closedate;
+my %bugsubmitter;
 sub check_bts_soap($) {
 	my $db = shift;
-	my %seen;
-	my %opendate;
-	my %closedate;
-	my %bugsubmitter;
 
 	use Data::Dumper;
 	use SOAP::Lite;
@@ -392,8 +392,8 @@
 	my $soap = SOAP::Lite->uri('Debbugs/SOAP')->proxy('http://bugs.debian.org/cgi-bin/soap.cgi');
 
 	foreach my $pkg (sort (grep { $db->has_status($_) } $db->list_packages())) {
+	    PKG_BTS:
 		foreach my $statusline (@{$db->status($pkg)}) {
-			my $changed = 0;
 			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;
@@ -402,6 +402,25 @@
 			next	unless    ($status_from_db eq 'bts')
 			               || ($status_from_db eq 'wontfix')
 			               || ($status_from_db eq 'fix');
+			if (check_bts_bug_soap ($db, $soap, $pkg, $statusline)) {
+				# The database was changed, we have to check
+				# again the list of status line for this
+				# package.
+				goto PKG_BTS;
+			}
+		}
+	}
+}
+
+sub check_bts_bug_soap ($) {
+	my $db = shift;
+	my $soap = shift;
+	my $pkg = shift;
+	my $statusline = shift;
+	my $changed = 0; # 0: No changes
+	                 # 1: Updated
+	                 # 2: New status added
+			my ($type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb) = @{$statusline};
 			my $bugwontfix = 0;
 
 			unless ($seen{$bug_nb}) {
@@ -410,7 +429,6 @@
 				my $soap_bugs = $soap->get_status($bug_nb)->result();
 				if (not length $soap_bugs) {
 					warn "Cannot find bug $bug_nb\n";
-#					$db->set_status($pkg, $type, $file, "2000-01-01 00:00:00 +0000", "done", $translator, $list, $url, $bug_nb);
 					next;
 				}
 
@@ -485,10 +503,9 @@
 			} elsif ($changed == 1) {
 				$db->set_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb, $statusline);
 			}
-		}
-	}
-}
-
+
+	return $changed;
+}
 
 =head2 clean-db
 




More information about the Debian-l10n-commits mailing list