[SCM] Debian package checker branch, master, updated. 2.5.10-159-g7b8db3d
The following commit has been merged in the master branch:
commit 76a8bc0e0d8484f346dd97c3ca96d7c66f828b8c
Author: Niels Thykier <niels@thykier.net>
Date: Fri Sep 21 15:06:46 2012 +0200
L::Collect: Accept control fields as 4th constructor arg
Allow callers to provide the control fields for the L::Collect object.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/lib/Lintian/Collect.pm b/lib/Lintian/Collect.pm
index 79d4a0f..7e8c42f 100644
--- a/lib/Lintian/Collect.pm
+++ b/lib/Lintian/Collect.pm
@@ -27,7 +27,7 @@ use Carp qw(croak);
# based on the package type, and return it. fail with unknown types,
# since we do not check in other packes if this returns a value.
sub new {
- my ($class, $pkg, $type, $base_dir) = @_;
+ my ($class, $pkg, $type, $base_dir, $fields) = @_;
my $object;
if ($type eq 'source') {
require Lintian::Collect::Source;
@@ -44,6 +44,7 @@ sub new {
$object->{name} = $pkg;
$object->{type} = $type;
$object->{base_dir} = $base_dir;
+ $object->{field} = $fields if defined $fields;
return $object;
}
@@ -159,7 +160,7 @@ data in memory.
=over 4
-=item new(PACKAGE, TYPE, BASEDIR)
+=item new(PACKAGE, TYPE, BASEDIR[, FIELDS])
Creates a new object appropriate to the package type. TYPE can be
retrieved later with the type() method. Croaks if given an unknown
@@ -170,6 +171,11 @@ It can be retrieved with the name() method.
BASEDIR is the base directory for the data and should be absolute.
+If FIELDS is given it is assumed to be the fields from the underlying
+control file. This is only used to avoid an unnecessary read
+operation (possibly incl. an ar | gzip pipeline) when the fields are
+already known.
+
=back
=head1 INSTANCE METHODS
--
Debian package checker
Reply to: