[SCM] Debian package checker branch, lab-refactor, updated. 2.5.3-186-gd1570a8
The following commit has been merged in the lab-refactor branch:
commit 71ff4734cda5edeb804281ab20661727cdd0824f
Author: Niels Thykier <niels@thykier.net>
Date: Wed Nov 2 10:07:42 2011 +0100
L::Lab: Fixed 2 bugs and changed get_package API
Adding missing use of Lintian::Collect and error out in _get_lab_index
if the type is undefined.
Updated the get_package documentation to reflect that the entry can
only be created if a Lintian::Processable is used. The other method
would silently fail and this was the "simplest" solution.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/lib/Lintian/Lab.pm b/lib/Lintian/Lab.pm
index f401a92..d56d7e0 100644
--- a/lib/Lintian/Lab.pm
+++ b/lib/Lintian/Lab.pm
@@ -70,6 +70,7 @@ BEGIN {
use Util qw(delete_dir get_dsc_info);
+use Lintian::Collect;
use Lintian::Lab::Entry;
use Lintian::Lab::Manifest;
@@ -203,7 +204,6 @@ used to narrow the search or even to add a new entry.
@extra consists of (in order):
- version
- arch (Ignored if $pkg_type is "source")
- - path to package
If version or arch is omitted (or undef) then that search parameter is
consider a wildcard for "any". Example:
@@ -219,9 +219,6 @@ consider a wildcard for "any". Example:
$pkg = $lab->get_package ('eclipse-platform', 'binary', '3.5.2-11', 'i386');
-If all 3 @extra arguments are given, then the entry will be created if
-it does not exist.
-
In list context, this returns a list of matches. In scalar context
this returns the first match (if any).
@@ -355,6 +352,7 @@ sub _get_lab_manifest_data {
# Note this is also used by reporting/html_reports
sub _get_lab_index {
my ($self, $pkg_type) = @_;
+ croak "Undefined (or empty) package type" unless $pkg_type;
croak "Unknown package type $pkg_type" unless $SUPPORTED_TYPES{$pkg_type};
# Fetch (or load) the index of that type
return $self->{'state'}->{$pkg_type} // $self->_load_lab_index ($pkg_type);
--
Debian package checker
Reply to: