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

[SCM] Debian package checker branch, master, updated. 2.2.18-41-gfe2b34c



The following commit has been merged in the master branch:
commit 30e3999e81b6cd91c37d220884667f5d6927b7a1
Author: Russ Allbery <rra@debian.org>
Date:   Thu Dec 24 12:44:54 2009 -0800

    Fix bugs in Lintian::Relation unparse and duplicates
    
    * lib/Lintian/Relation.pm:
      + [RA] Fix bugs in unparse() and duplicates() that caused duplicates()
        to crash when processing duplicates between an alternative and a
        regular package.  Thanks, Jonathan Yu.  (Closes: #559625)

diff --git a/debian/changelog b/debian/changelog
index 867c3c7..7ae7269 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -47,6 +47,10 @@ lintian (2.3.0) UNRELEASED; urgency=low
   * lib/Lintian/Output/XML.pm:
     + [RA] Rewrite to be more readable and fix the tags attribute for
       overridden experimental tags.
+  * lib/Lintian/Relation.pm:
+    + [RA] Fix bugs in unparse() and duplicates() that caused duplicates()
+      to crash when processing duplicates between an alternative and a
+      regular package.  Thanks, Jonathan Yu.  (Closes: #559625)
   * lib/Lintian/Tag/Info.pm:
     + [RA] Add a code method that returns the tag code corresponding to
       the severity and certainty for a tag, based on get_tag_code from
diff --git a/lib/Lintian/Relation.pm b/lib/Lintian/Relation.pm
index 84d9a25..2a4d8cd 100644
--- a/lib/Lintian/Relation.pm
+++ b/lib/Lintian/Relation.pm
@@ -196,8 +196,8 @@ sub duplicates {
             my $forward = $self->implies_array($self->[$i], $self->[$j]);
             my $reverse = $self->implies_array($self->[$j], $self->[$i]);
             if ($forward or $reverse) {
-                my $first = unparse($self->[$i]);
-                my $second = unparse($self->[$j]);
+                my $first = $self->unparse($self->[$i]);
+                my $second = $self->unparse($self->[$j]);
                 if ($seen{$first}) {
                     $dups{$seen{$first}}->{$second} = $j;
                     $seen{$second} = $seen{$first};
@@ -596,7 +596,7 @@ sub unparse {
     } elsif ($relation->[0] eq 'AND' || $relation->[0] eq 'OR') {
         my $seperator = ($relation->[0] eq 'AND') ? ', ' : ' | ';
         my $text = '';
-        for my $element (@$relation) {
+        for my $element (@$relation[1 .. $#$relation]) {
             $text .= $seperator if $text;
             my $result = $self->unparse($element);
             return unless defined($result);
diff --git a/t/tests/cruft-updated-libtool/debian/debian/control.in b/t/tests/fields-duplicate-build/debian/debian/control.in
similarity index 79%
copy from t/tests/cruft-updated-libtool/debian/debian/control.in
copy to t/tests/fields-duplicate-build/debian/debian/control.in
index b8924bb..4bd85f1 100644
--- a/t/tests/cruft-updated-libtool/debian/debian/control.in
+++ b/t/tests/fields-duplicate-build/debian/debian/control.in
@@ -3,7 +3,8 @@ Priority: extra
 Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7), libtool
+Build-Depends: debhelper (>= 7.0.50~), perl (>= 5.10) | libmodule-build-perl
+Build-Depends-Indep: perl (>= 5.10)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/fields-duplicate-build/desc b/t/tests/fields-duplicate-build/desc
new file mode 100644
index 0000000..7a0cc66
--- /dev/null
+++ b/t/tests/fields-duplicate-build/desc
@@ -0,0 +1,5 @@
+Testname: fields-duplicate-build
+Sequence: 6000
+Version: 1.0
+Description: Check for duplicate build relations
+Test-For: package-has-a-duplicate-build-relation
diff --git a/t/debs/deb-format-record-size/tags b/t/tests/fields-duplicate-build/tags
similarity index 100%
copy from t/debs/deb-format-record-size/tags
copy to t/tests/fields-duplicate-build/tags

-- 
Debian package checker


Reply to: