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

[SCM] Debian package checker branch, master, updated. 2.5.11-61-gbb86e1a



The following commit has been merged in the master branch:
commit bb86e1a0274a104839a40e92f8af7fdfed199a1d
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Jan 14 22:40:16 2013 +0100

    Special gcc -dev packages for dev-pkg-symlinks
    
    gcc stores its (some of its?) dev-pkg symlinks in special directories;
    make Lintian these when the source appears to be gcc.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/shared-libs b/checks/shared-libs
index dee5a7e..3d8b799 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -49,10 +49,11 @@ my %stack_arches = map { $_ => 1 }
       );
 
 my $ldconfig_dirs = Lintian::Data->new('shared-libs/ldconfig-dirs');
+my $MA_DIRS = Lintian::Data->new ('binaries/multiarch-dirs', qr/\s++/);
 
 sub run {
 
-my ($pkg, $type, $info, undef, $group) = @_;
+my ($pkg, $type, $info, $proc, $group) = @_;
 
 my $file;
 my $must_call_ldconfig;
@@ -240,15 +241,45 @@ for my $shlib_file (keys %SONAME) {
     } elsif (@devpkgs) {
         # -dev package - it needs a shlib symlink
         my $ok = 0;
+        my @alt;
 
         # If the shared library is in /lib, we have to look for the dev symlink
         # in /usr/lib
         $link_file = "usr/$link_file" unless $shlib_file =~ m,^usr/,;
 
+        push @alt, $link_file;
+
+        if ($proc->pkg_src =~ m/^gcc-(\d+.\d+)$/o) {
+            # gcc has a lot of bi-arch libs and puts the dev symlink
+            # in slightly different directories (to be co-installable
+            # with itself I guess).  Allegedly, clang (etc.) have to
+            # handle these special cases, so it should be
+            # acceptable...
+            my $gcc_ver = $1;
+            my $basename = basename ($link_file);
+            my $madir = $MA_DIRS->value ($proc->pkg_arch);
+            my $stem;
+            # Generally we are looking for
+            #  * usr/lib/gcc/MA-TRIPLET/$gcc_ver/{,32/,n32/,x32/,sf/,hf/}$basename
+            #
+            # The two-three letter name directory before the basename
+            # is bi-arch names.
+            $stem = "usr/lib/gcc/$madir/$gcc_ver" if defined $madir;
+            # But in the rare case we don't know the Multi-arch dir,
+            # just do without it as often (but not always) works.
+            $stem = "usr/lib/gcc/$gcc_ver" unless defined $madir;
+
+            push @alt, map { "$stem/$_"  } ('', qw(32 n32 x32 sf hf));
+        }
+
+      PKG:
         foreach my $devpkg (@devpkgs) {
-            if ($devpkg->info->index ($link_file)) {
-                $ok = 1;
-                last;
+            my $dinfo = $devpkg->info;
+            foreach my $link (@alt) {
+                if ($devpkg->info->index ($link)) {
+                    $ok = 1;
+                    last PKG;
+                }
             }
         }
         tag 'dev-pkg-without-shlib-symlink', "$shlib_file $link_file"
diff --git a/debian/changelog b/debian/changelog
index 7feb142..8203b4d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,9 @@ lintian (2.5.12) UNRELEASED; urgency=low
       to suppress empty-binary-package.  Lintian will still
       accept it the phrase for now.
     + [NT] Accept libx32 as an bi-arch directory.
+  * checks/shared-libs:
+    + [NT] Special case gcc packages when looking for dev symlinks.
+      gcc stores its dev symlinks in some special directories.
   * checks/menu-format{,.desc}:
     + [NT] Apply patch from Bastien Roucariès to detect missing
       "Keywords" in desktop files.  Thanks to Jeremy Bicha for

-- 
Debian package checker


Reply to: