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

[SCM] Debian package checker branch, master, updated. 2.5.6-121-ga7cc21e



The following commit has been merged in the master branch:
commit a7cc21e47a8edb28b860f4c323a19582f7ca2df7
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Apr 22 20:32:27 2012 +0200

    c/shared-libs: Fix dev-pkg-without-shlib-symlink tag
    
    Also add test case for the tag.  The "weird" tags in the libbaz
    (legacy) test appears to be caused by re-use of the SONAME for
    different files.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/shared-libs b/checks/shared-libs
index 6730b55..bebabe3 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -64,9 +64,13 @@ my @words;
 my $pkg = shift;
 my $type = shift;
 my $info = shift;
+my $proc = shift;
+my $group = shift;
 
 my $objdump = $info->objdump_info;
 
+my @devpkgs;
+
 # 1st step: get info about shared libraries installed by this package
 foreach my $file (sort keys %{$objdump}) {
     $SONAME{$file} = $objdump->{$file}->{SONAME}[0]
@@ -81,6 +85,15 @@ foreach my $file (@{$info->sorted_index}) {
     }
 }
 
+if (%SONAME) {
+    foreach my $bin ($group->get_binary_processables) {
+        next unless $bin->pkg_name =~ m/\-dev$/;
+        if ($bin->info->relation ('strong')->implies ($pkg)) {
+            push @devpkgs, $bin;
+        }
+    }
+}
+
 # 2nd step: read package contents
 
 for my $cur_file (@{$info->sorted_index}) {
@@ -221,23 +234,22 @@ for my $shlib_file (keys %SONAME) {
     # determine shlib link name (w/o version)
     $link_file =~ s/\.so.*$/.so/o;
 
-    # -dev package?
-    if ($pkg =~ m/\-dev$/o) {
-        # yes!!
-
-        # need shlib symlink
-        if (not exists $info->index->{$link_file}) {
-            tag 'dev-pkg-without-shlib-symlink', "$shlib_file $link_file";
-        }
-    } else {
-        # no.
-
-        # shlib symlink may not exist.
-        # if shlib doesn't _have_ a version, then $link_file and $shlib_file will
-        # be equal, and it's not a development link, so don't complain.
-        if (exists $info->index->{$link_file} and $link_file ne $shlib_file) {
-            tag 'non-dev-pkg-with-shlib-symlink', "$shlib_file $link_file";
+    # shlib symlink may not exist.
+    # if shlib doesn't _have_ a version, then $link_file and $shlib_file will
+    # be equal, and it's not a development link, so don't complain.
+    if (exists $info->index->{$link_file} and $link_file ne $shlib_file) {
+        tag 'non-dev-pkg-with-shlib-symlink', "$shlib_file $link_file";
+    } elsif (@devpkgs) {
+        # -dev package - it needs a shlib symlink
+        my $ok = 0;
+        foreach my $devpkg (@devpkgs) {
+            if (exists $devpkg->info->index->{$link_file}) {
+                $ok = 1;
+                last;
+            }
         }
+        tag 'dev-pkg-without-shlib-symlink', "$shlib_file $link_file"
+            unless $ok;
     }
 }
 
diff --git a/t/COVERAGE b/t/COVERAGE
index e9c2335..2464717 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,5 +1,5 @@
-Last generated 2012-03-19
-Coverage: 782/944 (82.84%), w. legacy tests: 887/944 (93.96%)
+Last generated 2012-04-22
+Coverage: 803/964 (83.30%), w. legacy tests: 908/964 (94.19%)
 
 The following tags are not tested by the test suite:
 
@@ -63,7 +63,6 @@ po-debconf missing-potfiles-in
 po-debconf missing-templates-pot
 po-debconf not-using-po-debconf
 
-shared-libs dev-pkg-without-shlib-symlink
 shared-libs ldconfig-symlink-is-not-a-symlink
 shared-libs ldconfig-symlink-referencing-wrong-file
 shared-libs non-dev-pkg-with-shlib-symlink
diff --git a/t/tests/group-checks-multi-arch/debian/debian/control.in b/t/tests/shared-libs-dev-symlink/debian/debian/control.in
similarity index 63%
copy from t/tests/group-checks-multi-arch/debian/debian/control.in
copy to t/tests/shared-libs-dev-symlink/debian/debian/control.in
index 0b5cbf8..522705b 100644
--- a/t/tests/group-checks-multi-arch/debian/debian/control.in
+++ b/t/tests/shared-libs-dev-symlink/debian/debian/control.in
@@ -1,27 +1,26 @@
 Source: {$srcpkg}
 Priority: extra
-Section: {$section}
+Section: libs
 Maintainer: {$author}
 Standards-Version: {$standards_version}
 Build-Depends: debhelper (>= 9)
 
-Package: pkg-foreign
-Architecture: all
-Depends: $\{misc:Depends\}
-Description: {$description} - pkg-foreign
+Package: libfoo1
+Architecture: any
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.
- .
- Should have been Multi-arch foreign package.
 
-Package: pkg-same
+Package: libfoo-dev
 Architecture: any
-Depends: $\{misc:Depends\}, pkg-foreign
-Multi-Arch: same
-Description: {$description} - pkg-same
+Section: libdevel
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\},
+          libfoo1 (= $\{binary:Version\})
+Description: {$description} - dev
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.
  .
- Multi-arch same package.
+ Dev package.
diff --git a/t/tests/shared-libs-dev-symlink/debian/debian/libfoo-dev.install b/t/tests/shared-libs-dev-symlink/debian/debian/libfoo-dev.install
new file mode 100644
index 0000000..e43b95c
--- /dev/null
+++ b/t/tests/shared-libs-dev-symlink/debian/debian/libfoo-dev.install
@@ -0,0 +1 @@
+usr/include
diff --git a/t/tests/shared-libs-dev-symlink/debian/debian/libfoo1.install b/t/tests/shared-libs-dev-symlink/debian/debian/libfoo1.install
new file mode 100644
index 0000000..08fa063
--- /dev/null
+++ b/t/tests/shared-libs-dev-symlink/debian/debian/libfoo1.install
@@ -0,0 +1 @@
+usr/lib/libfoo.so.*
diff --git a/t/tests/shared-libs-ldconfig-scripts/debian/debian/libfoo1.symbols b/t/tests/shared-libs-dev-symlink/debian/debian/libfoo1.symbols
similarity index 100%
copy from t/tests/shared-libs-ldconfig-scripts/debian/debian/libfoo1.symbols
copy to t/tests/shared-libs-dev-symlink/debian/debian/libfoo1.symbols
diff --git a/t/tests/shared-libs-dev-symlink/desc b/t/tests/shared-libs-dev-symlink/desc
new file mode 100644
index 0000000..dbe8b26
--- /dev/null
+++ b/t/tests/shared-libs-dev-symlink/desc
@@ -0,0 +1,6 @@
+Testname: shared-libs-dev-symlink
+Sequence: 6000
+Version: 1.0-1
+Type: non-native
+Description: Test checks related to symbols files
+Test-For: dev-pkg-without-shlib-symlink
diff --git a/t/tests/shared-libs-dev-symlink/tags b/t/tests/shared-libs-dev-symlink/tags
new file mode 100644
index 0000000..0ae8231
--- /dev/null
+++ b/t/tests/shared-libs-dev-symlink/tags
@@ -0,0 +1 @@
+W: libfoo1: dev-pkg-without-shlib-symlink usr/lib/libfoo.so.1.0.1 usr/lib/libfoo.so
diff --git a/t/tests/shared-libs-control-file/debian/Makefile b/t/tests/shared-libs-dev-symlink/upstream/Makefile
similarity index 78%
copy from t/tests/shared-libs-control-file/debian/Makefile
copy to t/tests/shared-libs-dev-symlink/upstream/Makefile
index 37bef22..a7a50b9 100644
--- a/t/tests/shared-libs-control-file/debian/Makefile
+++ b/t/tests/shared-libs-dev-symlink/upstream/Makefile
@@ -1,8 +1,7 @@
 CC=gcc
 CFLAGS+= -fPIC
 
-SONAMES:= libnoshf.so.1 libeshf.so.1 libunshf.so.1 libfdshf.so.1 \
-	  libdupshf.so.1
+SONAMES:= libfoo.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 
 all: $(LIBFILES)
@@ -15,9 +14,11 @@ clean:
 
 install: all
 	install -m 0755 -d $(DESTDIR)/usr/lib
+	install -m 0755 -d $(DESTDIR)/usr/include
 	install -m 0644 *.so* $(DESTDIR)/usr/lib
 	for FILE in $(SONAMES) ; do \
 	    ln -s $${FILE}.0.1 $(DESTDIR)/usr/lib/$$FILE ; \
 	done
+	install -m 0644 code.h $(DESTDIR)/usr/include
 
 .PHONY: install clean
diff --git a/t/tests/shared-libs-ldconfig-scripts/debian/code.c b/t/tests/shared-libs-dev-symlink/upstream/code.c
similarity index 92%
copy from t/tests/shared-libs-ldconfig-scripts/debian/code.c
copy to t/tests/shared-libs-dev-symlink/upstream/code.c
index 0ed08e0..9a88735 100644
--- a/t/tests/shared-libs-ldconfig-scripts/debian/code.c
+++ b/t/tests/shared-libs-dev-symlink/upstream/code.c
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <math.h>
+#include "code.h"
 
 double e(void (*f)(char *)){
   char tmp[10];
diff --git a/t/tests/shared-libs-dev-symlink/upstream/code.h b/t/tests/shared-libs-dev-symlink/upstream/code.h
new file mode 100644
index 0000000..570beae
--- /dev/null
+++ b/t/tests/shared-libs-dev-symlink/upstream/code.h
@@ -0,0 +1,8 @@
+#ifndef CODE_H_
+#define CODE_H_
+
+double e(void (*f)(char *));
+
+double energy(double mass);
+
+#endif
diff --git a/testset/tags.libbaz b/testset/tags.libbaz
index 992f8eb..26c57c5 100644
--- a/testset/tags.libbaz
+++ b/testset/tags.libbaz
@@ -49,6 +49,9 @@ W: libbaz source: package-depends-on-lower-priority-package libbaz2-dbg:optional
 W: libbaz source: source-nmu-has-incorrect-version-number 1-1
 W: libbaz source: substvar-source-version-is-deprecated libbaz2-dev
 W: libbaz1-dev: wrong-section-according-to-package-name libbaz1-dev => libdevel
+W: libbaz1: dev-pkg-without-shlib-symlink usr/lib/libbaz.so usr/lib/libbaz.so
+W: libbaz1: dev-pkg-without-shlib-symlink usr/lib/libbaz3.so.1.0.3b usr/lib/libbaz3.so
+W: libbaz1: dev-pkg-without-shlib-symlink usr/lib/libfoo2.so.1.0.3b usr/lib/libbaz2.so
 W: libbaz1: missing-depends-line
 W: libbaz1: new-package-should-close-itp-bug
 W: libbaz1: package-name-doesnt-match-sonames libbaz libbaz2-1.0 libbaz3-1

-- 
Debian package checker


Reply to: