[lintian] 07/11: harness: Rewrite log before processing backlog
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit e618a7328da6d933ad6f6d1bd992a7b683a69e38
Author: Niels Thykier <niels@thykier.net>
Date: Sat Dec 21 14:06:28 2013 +0100
harness: Rewrite log before processing backlog
Signed-off-by: Niels Thykier <niels@thykier.net>
---
reporting/harness | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/reporting/harness b/reporting/harness
index 8f36a7c..5e34ad4 100755
--- a/reporting/harness
+++ b/reporting/harness
@@ -398,7 +398,7 @@ if (defined($state) and time() >= $START_TIME + BACKLOG_PROCESSING_TIME_LIMIT){
Log('Processing backlog...') if @worklist;
while (@worklist and $state) {
- my @slice;
+ my (@slice, $filter_set);
if (time() >= $START_TIME + BACKLOG_PROCESSING_TIME_LIMIT) {
Log('No more time for processing backlogs');
last;
@@ -411,6 +411,9 @@ if (defined($state) and time() >= $START_TIME + BACKLOG_PROCESSING_TIME_LIMIT){
undef(@worklist);
}
+ $filter_set = generate_log_filter($LINTIAN_LAB, \@slice);
+ rewrite_lintian_log($lintian_log, $filter_set);
+
$state = process_worklist(\@slice, $lintian_log, $STATE_DIR, -1);
}
}
@@ -784,6 +787,28 @@ sub rewrite_lintian_log {
return 1;
}
+sub generate_log_filter {
+ my ($lintian_lab_path, $worklist_ref) = @_;
+ my $lab = Lintian::Lab->new($lintian_lab_path);
+ my %filter;
+ $lab->open;
+ for my $group_id (@{$worklist_ref}) {
+ my @res = $lab->lab_query("GROUP:${group_id}");
+ if (@res) {
+ foreach my $entry (@res) {
+ # Remove old log entry for all entries in this group
+ # NB: This part is unable to replace the update to %filter
+ # in the "foreach removed-entry in diff" above. In case
+ # the entire group is removed, we will enter this loop,
+ # but we will see each of the entries removed in the
+ # loop above.
+ $filter{$entry->identifier} = 1;
+ }
+ }
+ }
+ $lab->close;
+ return \%filter;
+}
sub find_backlog {
my ($state) = @_;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: