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

Bug#650838: [new check] incomplete multi-archification



Package: lintian
Version: 2.5.4
Severity: wishlist

The purpose of making a package "Multi-Arch: same" is to be to co-installable with itself. However, this is only possible if all its dependencies are either "Multi-Arch: same" or "Multi-Arch: foreign" (or "Multi-Arch: allowed", but that's not supported yet.)

The attached prototype patch implements intra-source check for this. The tag needs better name and better description. :)

--
Jakub Wilk
diff --git a/checks/group-checks b/checks/group-checks
--- a/checks/group-checks
+++ b/checks/group-checks
@@ -57,6 +57,7 @@
         push @nodes, $pname;
         $edges{$pname} = [map { $_->pkg_name } @$deps];
         _check_priorities ($proc, $deps);
+        _check_multiarch ($proc, $deps);
     }
 }
 
@@ -96,6 +97,21 @@
     }
 }
 
+sub _check_multiarch {
+    my ($proc, $deps) = @_;
+    my $ma = $proc->info->field('multi-arch') // 'no';
+    if ($ma eq 'same') {
+        foreach my $dep (@$deps) {
+            my $dma = $dep->info->field('multi-arch') // 'no';
+            if ($dma eq 'same' or $dma eq 'foreign') {
+                1; # OK
+            } else {
+                tag 'dependency-not-multi-arch-safe', $proc->pkg_name . " depends on " . $dep->pkg_name . " (multi-arch: $dma)";
+            }
+        }
+    }
+}
+
 ## Encapsulate Tarjan's algorithm in an class/object to keep
 ## the run sub somewhat sane.
 package Lintian::group_checks::Graph;
diff --git a/checks/group-checks.desc b/checks/group-checks.desc
--- a/checks/group-checks.desc
+++ b/checks/group-checks.desc
@@ -33,3 +33,10 @@
  package.  A full check of all dependencies built from different
  source packages is beyond the scope of Lintian.  The depcheck service
  can do this.
+
+Tag: dependency-not-multi-arch-safe
+Severity: normal
+Certainty: possible
+Info: The package is Multi-Arch "same", but it depends on a package that
+ is neither Multi-Arch "same" nor "foreign".
+Ref: https://wiki.ubuntu.com/MultiarchSpec

Reply to: