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

[SCM] Debian package checker branch, vendor-profile, updated. 2.5.1-34-g30085d6



The following commit has been merged in the vendor-profile branch:
commit 30085d6c2082d12a8b15c9cf8f33ab1b9a61bed1
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Jun 23 15:48:52 2011 +0200

    Fixed profile handling in lintian-info

diff --git a/frontend/lintian-info b/frontend/lintian-info
index 881a9fe..c512db1 100755
--- a/frontend/lintian-info
+++ b/frontend/lintian-info
@@ -43,6 +43,11 @@ use Lintian::Tag::Info ();
 use Text_utils;
 
 my %already_displayed = ();
+my @proc_inc = (
+    "$ENV{HOME}/.lintian/profiles",
+    '/etc/lintian/profiles',
+    "$ENV{'LINTIAN_ROOT'}/profiles"
+);
 my ($annotate, $tags, $help, $prof);
 Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
 GetOptions(
@@ -69,12 +74,10 @@ EOT
 }
 
 unless ($prof) {
-    $prof = find_default_profile(
-	"$ENV{HOME}/.lintian/profiles",
-	'/etc/lintian/profiles',
-	"$ENV{'LINTIAN_ROOT'}/profiles");
+    $prof = find_default_profile(@proc_inc);
+
 }
-load_profile($prof);
+load_profile($prof, \@proc_inc);
 
 # If tag mode was specified, read the arguments as tags and display the
 # descriptions for each one.  (We don't currently display the severity,
@@ -135,12 +138,12 @@ while (<>) {
 
 exit 0;
 
-# load_profile($profname)
+# load_profile($profname, $proc_inc_ref)
 #  Loads the profile called $profname and applies
 #  the relevant changes from it.
 sub load_profile{
-    my ($profname) = @_;
-    my $profile = Lintian::Profile->new($prof);
+    my ($profname, $proc_inc_ref) = @_;
+    my $profile = Lintian::Profile->new($prof, $proc_inc_ref);
     my $severities = $profile->severity_changes;
     while ( my ($tagname, $severity) = each(%$severities) ){
 	my $tag = Lintian::Tag::Info->new($tagname);
diff --git a/lib/Lintian/Profile.pm b/lib/Lintian/Profile.pm
index 5ed99d1..552bd50 100644
--- a/lib/Lintian/Profile.pm
+++ b/lib/Lintian/Profile.pm
@@ -106,7 +106,9 @@ sub find_profile {
     my $pfile;
     fail "$pname is not a valid profile name\n" if $pname =~ m/\./o;
     # Allow @dirs to override the default path for this profile-search
-    push @dirs, @{ $self->{'profile-path'} } if ref $self;
+    if (ref $self) {
+        push @dirs, @{ $self->{'profile-path'} } if defined $self->{'profile-path'};
+    }
     # $vendor is short for $vendor/main
     $pname = "$pname/main" unless $pname =~ m,/,o;
     $pfile = "$pname.profile";

-- 
Debian package checker


Reply to: