[SCM] Debian package checker branch, master, updated. 2.5.15-2-g2ff5739
The following commit has been merged in the master branch:
commit 2ff5739424073265310ad2a02cd0036a21c8ea01
Author: Niels Thykier <niels@thykier.net>
Date: Fri Jul 26 00:19:02 2013 +0200
L::ProcessableGroup: Extend clear_cache to all members
Merge the "clear_group_cache" from the frontend into
L::ProcessableGroup's clear_cache method.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/frontend/lintian b/frontend/lintian
index 64a6a24..fce8791 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -1177,7 +1177,7 @@ foreach my $gname (sort $pool->get_group_names()) {
unpack_group ($gname, $group);
if ($action eq 'check'){
process_group($group);
- clear_group_cache($group);
+ $group->clear_cache;
# Double check that no processes are running; hopefully
# it will catch regressions like 3bbcc3b earlier.
fail ('Unreaped processes after running checks!?')
@@ -1461,19 +1461,6 @@ sub process_group {
return 1;
}
-
-# cleans the cache of all elements in this group - this avoids
-# memory being hogged by packages/groups that have been checked
-# and will not be checked again.
-sub clear_group_cache {
- my ($group) = @_;
- foreach my $proc ($group->get_processables()){
- $proc->clear_cache;
- }
- $group->clear_cache;
- return 1;
-}
-
sub handle_lab_query {
my ($query) = @_;
my @res;
diff --git a/lib/Lintian/ProcessableGroup.pm b/lib/Lintian/ProcessableGroup.pm
index 9a3f6f7..d8bd684 100644
--- a/lib/Lintian/ProcessableGroup.pm
+++ b/lib/Lintian/ProcessableGroup.pm
@@ -312,13 +312,17 @@ sub info {
=item $group->clear_cache
-Discard the info element, so the memory used by it can be reclaimed.
-Mostly useful when checking a lot of packages (e.g. on lintian.d.o).
+Discard the info element of all members of this group, so the memory
+used by it can be reclaimed. Mostly useful when checking a lot of
+packages (e.g. on lintian.d.o).
=cut
sub clear_cache {
my ($self) = @_;
+ for my $proc ($self->get_processables) {
+ $proc->clear_cache;
+ }
delete $self->{info};
return;
}
--
Debian package checker
Reply to: