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

[SCM] Debian package checker branch, master, updated. 2.2.6-65-g69bc0fc



The following commit has been merged in the master branch:
commit 988168398d5e56adb1feeed524afad9d44849440
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Mon Feb 23 01:39:32 2009 -0600

    Check for libtool files with bad paths
    
    * checks/shared-libs{,.desc}:
      + [RA] Check the libdir path in libtool *.la files and ensure that it
        matches the installed location of the *.la file.  Based on a patch
        by Raphael Geissert.  (Closes: #302196)

diff --git a/checks/shared-libs b/checks/shared-libs
index e999826..972455e 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -159,6 +159,19 @@ for my $cur_file (sort keys %{$info->index}) {
 	     && $ldconfig_dirs->known(dirname($cur_file))
 	     && exists $sharedobject{$cur_file}) {
 	tag "sharedobject-in-library-directory-missing-soname", "$cur_file";
+    } elsif ($cur_file =~ m/\.la$/ and not defined($cur_file_data->{link})) {
+	local $_;
+	open(LAFILE, "< unpacked/$cur_file")
+	    or fail("Could not open unpacked/$cur_file for reading!");
+	while(<LAFILE>) {
+	    next unless (m/^libdir='(.+?)'$/);
+	    my $actual = $1;
+	    my ($expected) = ("/$cur_file" =~ m,^(.+)/[^/]+$,);
+	    tag "incorrect-libdir-in-la-file", $cur_file, "$actual != $expected"
+		unless($expected eq $actual);
+	    last;
+	}
+	close(LAFILE);
     }
 }
 
diff --git a/checks/shared-libs.desc b/checks/shared-libs.desc
index 3364243..3a8b79b 100644
--- a/checks/shared-libs.desc
+++ b/checks/shared-libs.desc
@@ -401,3 +401,12 @@ Info: The listed shared library calls the C library exit() or _exit()
  .
  In most cases, removing the call should be discussed with upstream,
  particularly as it may produce an ABI change.
+
+Tag: incorrect-libdir-in-la-file
+Severity: important
+Certainty: possible
+Info: The given .la file points to a libdir other than the path where it is
+ installed.  This can be caused by resetting <tt>prefix</tt> at make install
+ time instead of using <tt>DESTDIR</tt>.  The incorrect path will cause
+ packages linking to this library using libtool to build incorrectly (adding
+ incorrect paths to RPATH, for example).
diff --git a/debian/changelog b/debian/changelog
index 0a4205f..bd521fe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ lintian (2.2.7) UNRELEASED; urgency=low
       - apparently-truncated-elf-binary
       - copyright-refers-to-nonexistent-license-file
       - embedded-zlib
+      - incorrect-libdir-in-la-file
 
   * checks/binaries{,.desc}:
     + [RA] Check for embedded copies of zlib in ELF binaries by looking
@@ -84,7 +85,7 @@ lintian (2.2.7) UNRELEASED; urgency=low
     + [ADB] Use Lintian::Relation rather than Dep.
     + [ADB] Update lists of known interpreter versions (add jruby1.1,
       octave3.1 and remove jruby0.9)
-  * checks/shared-libs:
+  * checks/shared-libs{,.desc}:
     + [ADB] When parsing symbols files, correctly ensure that meta-information
       occurs between the end of the dependency template(s) and the start of
       the symbol list.  The code that was intended to check this resulted
@@ -96,6 +97,9 @@ lintian (2.2.7) UNRELEASED; urgency=low
     + [ADB] Use Lintian::Relation rather than Dep.
     + [ADB] Avoid capturing parentheses in regexes due to their minor
       performance penalty.
+    + [RA] Check the libdir path in libtool *.la files and ensure that it
+      matches the installed location of the *.la file.  Based on a patch
+      by Raphael Geissert.  (Closes: #302196)
   * checks/version-substvars:
     + [RA] Be robust against whitespace in the Architecture field.
       Thanks, Gonéri Le Bouder.  (Closes: #517555)
diff --git a/t/tests/shared-libs-la-files/debian/debian/install b/t/tests/shared-libs-la-files/debian/debian/install
new file mode 100644
index 0000000..a814785
--- /dev/null
+++ b/t/tests/shared-libs-la-files/debian/debian/install
@@ -0,0 +1 @@
+kio_locate.la usr/lib/kde3
diff --git a/t/tests/shared-libs-la-files/debian/debian/links b/t/tests/shared-libs-la-files/debian/debian/links
new file mode 100644
index 0000000..c34baaf
--- /dev/null
+++ b/t/tests/shared-libs-la-files/debian/debian/links
@@ -0,0 +1 @@
+var/lib/kde3/kio_locate.la var/lib/kde3/foo.la
diff --git a/t/tests/shared-libs-la-files/debian/kio_locate.la b/t/tests/shared-libs-la-files/debian/kio_locate.la
new file mode 100644
index 0000000..4391635
--- /dev/null
+++ b/t/tests/shared-libs-la-files/debian/kio_locate.la
@@ -0,0 +1,15 @@
+# Generated by ltmain.sh - GNU libtool 1.5.18 - (pwn3d by bksys)
+#
+#
+dlname='kio_locate.so'
+library_names='kio_locate.so kio_locate.so kio_locate.so'
+old_library=''
+dependency_libs=''
+current=0
+age=0
+revision=0
+installed=yes
+shouldnotlink=no
+dlopen=''
+dlpreopen=''
+libdir='/build/buildd/kio-locate-0.4.5+ds/debian/kio-locate/usr/lib/kde3'
\ No newline at end of file
diff --git a/t/tests/shared-libs-la-files/desc b/t/tests/shared-libs-la-files/desc
new file mode 100644
index 0000000..4e5ce00
--- /dev/null
+++ b/t/tests/shared-libs-la-files/desc
@@ -0,0 +1,5 @@
+Testname: shared-libs-la-files
+Sequence: 6000
+Version: 1.0
+Description: Test checks related to libtool .la files
+Test-For: incorrect-libdir-in-la-file
diff --git a/t/tests/shared-libs-la-files/tags b/t/tests/shared-libs-la-files/tags
new file mode 100644
index 0000000..5e31e3c
--- /dev/null
+++ b/t/tests/shared-libs-la-files/tags
@@ -0,0 +1 @@
+E: shared-libs-la-files: incorrect-libdir-in-la-file usr/lib/kde3/kio_locate.la /build/buildd/kio-locate-0.4.5+ds/debian/kio-locate/usr/lib/kde3 != /usr/lib/kde3

-- 
Debian package checker


Reply to: