[SCM] Debian package checker branch, master, updated. 2.5.0-rc2-122-g12888e8
The following commit has been merged in the master branch:
commit 0f6b6f2675d9522e1f6b2336a7d5da8bd616afb1
Author: Niels Thykier <niels@thykier.net>
Date: Tue Mar 29 18:20:32 2011 +0200
Corrected handling of name of changes in L::Processable
Some of the tests do not follow the standard naming convention
for changes files, which made L::Processable keep the .changes
extension.
diff --git a/lib/Lintian/Processable.pm b/lib/Lintian/Processable.pm
index c238dcd..65bb832 100644
--- a/lib/Lintian/Processable.pm
+++ b/lib/Lintian/Processable.pm
@@ -164,7 +164,14 @@ sub _init{
my $cinfo = get_dsc_info ($pkg_path) or fail "$pkg_path is not a valid changes file";
my $pkg_name = $pkg_path;
my $pkg_version = $cinfo->{version};
- $pkg_name =~ s,.*/([^/_]+)_[^/]+\.changes$,$1,;
+ $pkg_name =~ s,.*/,,og; # strip directories (if any)
+ if ($pkg_name =~ m/_/o){
+ # regular named changes file
+ $pkg_name =~ s,^([^/_]+)_[^/]+\.changes$,$1,;
+ } else {
+ # irregular changes file (e.g. some of our tests trigger this)
+ $pkg_name =~ s,\.changes$,,o;
+ }
$self->{pkg_name} = $pkg_name;
$self->{pkg_version} = $pkg_version;
$self->{pkg_src} = $cinfo->{source}//$pkg_name;
--
Debian package checker
Reply to: