[Debian-l10n-commits] r1117 - in /dl10n/trunk: Changelog lib/Debian/L10n/Spider.pm

nekral-guest at users.alioth.debian.org nekral-guest at users.alioth.debian.org
Sun Aug 3 18:07:53 UTC 2008


Author: nekral-guest
Date: Sun Aug  3 18:07:53 2008
New Revision: 1117

URL: http://svn.debian.org/wsvn/?sc=1&rev=1117
Log:
	* lib/Debian/L10n/Spider.pm: Keep history in the database. Use
	add_status(), instead of set_status(), except when a statusline is
	just fixed (name, date updated).

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=1117&op=diff
==============================================================================
--- dl10n/trunk/Changelog (original)
+++ dl10n/trunk/Changelog Sun Aug  3 18:07:53 2008
@@ -1,3 +1,9 @@
+2008-08-03  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* lib/Debian/L10n/Spider.pm: Keep history in the database. Use
+	add_status(), instead of set_status(), except when a statusline is
+	just fixed (name, date updated).
+
 2008-08-03  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* lib/Debian/L10n/Db.pm (del_status): Add support for clearing a

Modified: dl10n/trunk/lib/Debian/L10n/Spider.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/L10n/Spider.pm?rev=1117&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/L10n/Spider.pm (original)
+++ dl10n/trunk/lib/Debian/L10n/Spider.pm Sun Aug  3 18:07:53 2008
@@ -394,6 +394,7 @@
 
 	foreach my $pkg (sort (grep { $db->has_status($_) } $db->list_packages())) {
 		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;
@@ -452,6 +453,7 @@
 				if ($status_from_db ne 'done') {
 					print "close #$bug_nb of $pkg (at $closedate{$bug_nb})\n";
 					$status_from_db = 'done';
+					$changed = 1;
 				}
 			} else {
 				if ($opendate{$bug_nb} ne $date) {
@@ -461,6 +463,7 @@
 				if ($bugwontfix and $status_from_db ne 'wontfix') {
 					print "wontfix #$bug_nb of $pkg\n";
 					$status_from_db = 'wontfix';
+					$changed = 1;
 				}
 			}
 			if ($bugsubmitter{$bug_nb} ne $translator) {
@@ -470,8 +473,13 @@
 			if ($status_from_db eq 'wontfix' and not $bugwontfix) {
 				print "removing wontfix tag for #$bug_nb of $pkg\n";
 				$status_from_db = 'bts';
-			}
-			$db->set_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb);
+				$changed = 1;
+			}
+			if ($changed) {
+				$db->add_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb);
+			} else {
+				$db->set_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb, $statusline);
+			}
 		}
 	}
 }
@@ -513,7 +521,7 @@
 				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->set_status($pkg, $type, $file, "2000-01-01 00:00:00 +0000", "done", $translator, $list, $url, $bug_nb);
+				  $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) {
@@ -604,7 +612,7 @@
 					$status_from_db = 'bts';
 				}
 			}
-			$db->set_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb);
+			$db->add_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb);
 		}
 	}
 	$ldap->unbind;
@@ -641,7 +649,7 @@
 			my $time_done = timelocal(0,0,0, $3,$2-1,$1);
 			if ($now - $time_done > $offset) {
 				print "Remove ".($bug_nb?"#$bug_nb":"bug")." about the $type of $pkg because it's done since more than 3 days old\n";
-				$db->del_status($pkg, $type, $statusline);
+				$db->del_status($pkg, $type, $file);
 #				$i--;
 			}
 		}
@@ -764,7 +772,7 @@
 						$db->package($pkg);
 						$db->add_package($pkg,$pkg);
 					}
-					$db->set_status($pkg, $type, $file, $date, $status, $translator, $list, $url, ($bug_nb || ""));
+					$db->add_status($pkg, $type, $file, $date, $status, $translator, $list, $url, ($bug_nb || ""));
 					print "Insert $type#$file#$date#$status#$translator#$list#$url#".($bug_nb ? "$bug_nb" : "")."\n";
 				}
 			} continue {




More information about the Debian-l10n-commits mailing list