[SCM] Debian package checker branch, master, updated. 2.5.4-144-gadb9815
The following commit has been merged in the master branch:
commit adb981539497eeb8ecf76d0ccf76c66b890de595
Author: Niels Thykier <niels@thykier.net>
Date: Sat Feb 4 16:22:14 2012 +0100
Minor fixup of L::Processable{,::Package}
Remove an unused constant and fixed a documentation typo. Fixed
info caching for L::P::Package and revised L::P info.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/lib/Lintian/Processable.pm b/lib/Lintian/Processable.pm
index 80b10f2..b5f4ebe 100644
--- a/lib/Lintian/Processable.pm
+++ b/lib/Lintian/Processable.pm
@@ -26,9 +26,6 @@ use warnings;
use Carp qw(croak);
-# Black listed characters - any match will be replaced with a _.
-use constant EVIL_CHARACTERS => qr,[/&|;\$"'<>],o;
-
=head1 NAME
Lintian::Processable -- An (abstract) object that Lintian can process
@@ -141,20 +138,15 @@ Lintian::Processable->mk_accessors (qw(group));
Returns L<Lintian::Collect|$info> element for this processable.
-Note: This method is must implemented by sub-classes.
+Note: This method must implemented by sub-classes unless they
+provide an "info" field.
=cut
sub info {
my ($self) = @_;
- my $info = $self->{info};
- if (! defined $info) {
- my $lpkg = $self->lab_pkg();
- croak "Need a Lab package before creating a Lintian::Collect\n"
- unless defined $lpkg;
- return $lpkg->info;
- }
- return $info;
+ return $self->{info} if exists $self->{info};
+ croak "Not implemented.\n";
}
=item $proc->clear_cache
diff --git a/lib/Lintian/Processable/Package.pm b/lib/Lintian/Processable/Package.pm
index 9fcc2fd..169f389 100644
--- a/lib/Lintian/Processable/Package.pm
+++ b/lib/Lintian/Processable/Package.pm
@@ -157,7 +157,7 @@ sub _init {
# Derive the name from the file name
# - the name is the part of the basename up to (and excl.) the first "_".
#
-# _derivate_name ('somewhere/lintian_2.5.2_amd64.changes', 'changes') eq 'lintian'
+# _derive_name ('somewhere/lintian_2.5.2_amd64.changes', 'changes') eq 'lintian'
sub _derive_name {
my ($file, $ext) = @_;
my ($name) = ($file =~ m,(?:.*/)?([^_/]+)[^/]*\.$ext$,);
@@ -177,7 +177,8 @@ sub info {
my $lpkg = $self->lab_pkg();
croak "Need a Lab package before creating a Lintian::Collect\n"
unless defined $lpkg;
- return $lpkg->info;
+ $info = $lpkg->info;
+ $self->{info} = $info;
}
return $info;
}
--
Debian package checker
Reply to: