[SCM] Debian package checker branch, infra-513663, updated. 2.5.0-rc1-121-g96b50fe
The following commit has been merged in the infra-513663 branch:
commit 86bf74eff9e16e5163a3c866335fd9816515ef98
Author: Niels Thykier <niels@thykier.net>
Date: Fri Apr 1 18:21:42 2011 +0200
Handle remove action as early as possible
Since the remove action does not depend on any collection, tag or
check information, it can be handled as soon as we know what
packages to process in the lab.
diff --git a/frontend/lintian b/frontend/lintian
index cf7fd08..2d77218 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -849,6 +849,41 @@ if ($pool->empty()) {
}
# }}}
+# {{{ Handle $action eq 'remove'
+# We have enough information to handle remove now.
+
+if($action eq 'remove'){
+ # Handle remove here - makes the unpack/check loop simpler.
+ foreach my $group ($pool->get_groups()){
+ foreach my $proc ($group->get_processables()){
+ my $lpkg;
+ my $pkg_name = $proc->pkg_name();
+ my $pkg_ver = $proc->pkg_version();
+ my $pkg_type = $proc->pkg_type();
+ my $pkg_path = $proc->pkg_path();
+ eval{
+ $lpkg = $LAB->get_lab_package($pkg_name, $pkg_ver,
+ $pkg_type, $pkg_path);
+ };
+ if(!defined($lpkg)){
+ my $err = '.';
+ $err = ": $@" if(defined($@));
+ warning("skipping $action of $pkg_type package ${pkg_name}$err");
+ $exit_code = 2;
+ next;
+ }
+ $TAGS->file_start($pkg_path, $pkg_name, $pkg_ver,
+ $proc->pkg_arch(), $pkg_type);
+ unless($lpkg->delete_lab_entry()){
+ $exit_code = 2;
+ }
+ }
+ }
+ $TAGS->file_end();
+ exit $exit_code;
+}
+# }}}
+
# {{{ Load information about collector scripts
load_collections(\%collection_info, "$LINTIAN_ROOT/collection");
# }}}
@@ -987,41 +1022,6 @@ debug_msg(1,
scalar($map->missing()) == 0
or fail('There are missing nodes on the resolver: '.join(', ', $map->missing()));
-## REFACTORING NOTES:
-## If we are here $action is one of "check", "unpack" or "remove"
-##
-
-if($action eq 'remove'){
- # Handle remove here - makes the unpack/check loop simpler.
- foreach my $group ($pool->get_groups()){
- foreach my $proc ($group->get_processables()){
- my $lpkg;
- my $pkg_name = $proc->pkg_name();
- my $pkg_ver = $proc->pkg_version();
- my $pkg_type = $proc->pkg_type();
- my $pkg_path = $proc->pkg_path();
- eval{
- $lpkg = $LAB->get_lab_package($pkg_name, $pkg_ver,
- $pkg_type, $pkg_path);
- };
- if(!defined($lpkg)){
- my $err = '.';
- $err = ": $@" if(defined($@));
- warning("skipping $action of $pkg_type package ${pkg_name}$err");
- $exit_code = 2;
- next;
- }
- $TAGS->file_start($pkg_path, $pkg_name, $pkg_ver,
- $proc->pkg_arch(), $pkg_type);
- unless($lpkg->delete_lab_entry()){
- $exit_code = 2;
- }
- }
- }
- $TAGS->file_end();
- exit $exit_code;
-}
-
# Now action is always either "check" or "unpack"
# these two variables are used by process_package
# and need to persist between invocations.
--
Debian package checker
Reply to: