[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, infra-513663, updated. 2.5.0-rc1-123-g2958437



The following commit has been merged in the infra-513663 branch:
commit 2958437822e4193e10816e9a950ea123149ba935
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Apr 2 12:00:31 2011 +0200

    Made Processable carry $info and $lpkg instead of some hashref

diff --git a/frontend/lintian b/frontend/lintian
index c16053d..9df42a5 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -1038,8 +1038,8 @@ foreach my $gname (sort $pool->get_group_names()) {
     my $group = $pool->get_group($gname);
     my $ginfo = {};
     my $glpkg = {};
-    unpack_group($group, $ginfo, $glpkg);
-    process_group($group, $ginfo, $glpkg) if $action eq 'check';
+    unpack_group($group);
+    process_group($group) if $action eq 'check';
 }
 
 $TAGS->file_end();
@@ -1298,7 +1298,7 @@ sub post_pkg_process_overrides{
 }
 
 sub unpack_group {
-    my ($group, $ginfo, $glpkg) = @_;
+    my ($group) = @_;
   PROC:
     foreach my $proc ($group->get_processables()){
 	my $pkg_name = $proc->pkg_name();
@@ -1410,9 +1410,7 @@ sub unpack_group {
 
 	if ($action eq 'check') {
 	    # We only need this if we are checking the package later
-	    $cid = $pkg_name . '_' . $proc->pkg_arch() . '_' . $pkg_ver;
-	    $ginfo->{$pkg_type}->{$cid} = Lintian::Collect->new($pkg_name, $pkg_type);
-	    $glpkg->{$pkg_type}->{$cid} = $lpkg;
+	    $proc->lab_pkg($lpkg);
 	} else {
 	    # else we are done - not sure if it makes any sense if we are unpacking
 	    # but this is the old behaviour, so we stick with it.
@@ -1429,7 +1427,7 @@ sub unpack_group {
 }
 
 sub process_group {
-    my ($group, $ginfo, $glpkg) = @_;
+    my ($group) = @_;
   PROC:
     foreach my $proc ($group->get_processables()){
 	my $pkg_name = $proc->pkg_name();
@@ -1437,10 +1435,8 @@ sub process_group {
 	my $pkg_type = $proc->pkg_type();
 	my $pkg_path = $proc->pkg_path();
 	my $pkg_arch = $proc->pkg_arch();
-	my $cid = $pkg_name . '_' . $proc->pkg_arch() . '_' . $proc->pkg_version();
-	my $lpkg = $glpkg->{$pkg_type}->{$cid};
-	my $info = $ginfo->{$pkg_type}->{$cid};
-
+	my $lpkg = $proc->lab_pkg();
+	my $info = $proc->info();
 	my $base = $lpkg->base_dir();
 
 	$TAGS->file_start($pkg_path, $pkg_name, $pkg_ver, $pkg_arch, $pkg_type);
diff --git a/lib/Lintian/Processable.pm b/lib/Lintian/Processable.pm
index bd6499c..40984d9 100644
--- a/lib/Lintian/Processable.pm
+++ b/lib/Lintian/Processable.pm
@@ -122,7 +122,31 @@ to less dangerous (but possibly invalid) values.
 
 Lintian::Processable->mk_ro_accessors (qw(pkg_name pkg_version pkg_src pkg_arch pkg_path pkg_type pkg_src_version group tainted));
 
-=pod
+=item $proc->info()
+
+Returns L<Lintian::Collect|$info> element for this processable.
+
+=cut
+
+sub info{
+    my ($self) = @_;
+    my $info = $self->{info};
+    if (! defined $info) {
+        # load only if we need it
+        require Lintian::Collect;
+        my $info = Lintian::Collect->new($self->pkg_name(), $self->pkg_type());
+        $self->{info} = $info;
+    }
+    return $info;
+}
+
+=item $proc->lab_pkg([$lpkg])
+
+Returns or sets the L<Lab::Package|$info> element for this processable.
+
+=cut
+
+Lintian::Processable->mk_accessors (qw(lab_pkg));
 
 =item $proc->set_group($group)
 

-- 
Debian package checker


Reply to: