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

[SCM] Debian package checker branch, master, updated. 2.5.4-84-g760c723



The following commit has been merged in the master branch:
commit 760c723e8ec0f1443bca4a2a5a05aa7ddeaa3605
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Jan 11 15:32:13 2012 +0100

    L::Profile: Improve the "recursive definition"-check
    
    Catch profiles that are recursively defined, but where the Profile
    field of the child and Extend field of the parent are not identical.
    This can happen if one profile uses "$vendor" and another uses
    "$vendor/main" or if symlinks are involved.
    
    This patch solves the issue by deferring the check until the child
    profile has been read.  Then it can use the Profile field as the
    "canonical" name for the profile.
    
    Note the parents field will use the value in the Extends field and not
    the Profile field in the child profile.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index bbb3174..ab47be1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -159,6 +159,10 @@ lintian (2.5.5) UNRELEASED; urgency=low
   * lib/Lintian/Processable/Package.pm:
     + [NT] Use part of the file name as package name if the mandatory
       "Package" or "Source" fields are missing rather than choking.
+  * lib/Lintian/Profile.pm:
+    + [NT] Catch recursively defined profiles when the Profile field
+      contains a (slightly) different name than the Extends field of
+      its parent.  (Closes: #655469)
   * lib/Lintian/Tag/Info.pm:
     + [NT] Accepted patch from Evan Broder to always output effective
       severity in tag descriptions.
diff --git a/lib/Lintian/Profile.pm b/lib/Lintian/Profile.pm
index 770c145..6725f28 100644
--- a/lib/Lintian/Profile.pm
+++ b/lib/Lintian/Profile.pm
@@ -147,7 +147,7 @@ sub new {
 =item $prof->parents
 
 Returns a list ref of the names of its parents, in the order they are
-apply.
+applied.
 
 Note: This list reference and its contents should not be modified.
 
@@ -255,6 +255,8 @@ sub _read_profile {
     $pname = $pheader->{'profile'};
     croak "Invalid Profile field in $pfile.\n"
             if $pname =~ m,^/,o or $pname =~ m/\./o;
+    croak "Recursive definition of $pname.\n"
+        if exists $pmap->{$pname};
     $pmap->{$pname} = 0; # Mark as being loaded.
     $self->{'name'} = $pname unless exists $self->{'name'};
     if (exists $pheader->{'extends'} ){
@@ -263,12 +265,12 @@ sub _read_profile {
         my $parentf;
         croak "Invalid Extends field in $pfile.\n"
             unless $parent && $parent !~ m/\./o;
-        croak "Recursive definition of $parent.\n"
-            if exists $pmap->{$parent};
         $parentf = $self->find_profile($parent);
         croak "Cannot find $parent, which $pname extends.\n"
             unless $parentf;
         $self->_read_profile($parentf);
+        # Use the extends field in parents, even though the extended
+        # profile might actually identity itself differently.
         push @$plist, $parent;
     }
     $self->_read_profile_tags($pname, $pheader);

-- 
Debian package checker


Reply to: