1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 500-backport-1.23.22-checks-binaries.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Backported checks from lintian 1.23.22.
8 diff -urNad lintian-1.23.8~/checks/binaries lintian-1.23.8/checks/binaries
9 --- lintian-1.23.8~/checks/binaries 2004-07-07 20:17:54.000000000 +0000
10 +++ lintian-1.23.8/checks/binaries 2006-07-18 13:33:57.000000000 +0000
12 -# binaries -- lintian check script
13 +# binaries -- lintian check script -*- perl -*-
15 # Copyright (C) 1998 Christian Schwarz and Richard Braakman
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, you can find it on the World Wide
20 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
21 -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 -# MA 02111-1307, USA.
23 +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
24 +# MA 02110-1301, USA.
26 package Lintian::binaries;
35 # read architecture file
36 if (open(IN,"fields/architecture")) {
38 push @{$NEEDED{$file}}, $1;
39 } elsif (m/^\s*RPATH\s*(\S+)/o) {
41 + } elsif (m/^\s*SONAME\s*(\S+)/o) {
43 + push @{$SONAME{$1}}, $file;
44 } elsif (m/^\s*\d+\s+\.comment\s+/o) {
46 } elsif (m/^\s*\d+\s+\.note\s+/o) {
48 fail("file format not recognized for $1\nif you are checking non-i386 binaries, you'll need to install binutils-multiarch\n");
49 } elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
50 tag "binary-file-compressed-with-upx", "$1";
51 + } elsif (m/^objdump: \.(.*?): Invalid operation$/) {
52 + tag "binary-with-bad-dynamic-table", "$file" unless $file =~ m%^\./usr/lib/debug/%;
55 + } elsif (m%Requesting program interpreter:\s+/lib/klibc-\S+\.so%) {
62 +# For the package naming check, filter out SONAMEs where all the files are
63 +# at paths other than /lib, /usr/lib, or /usr/X11R6/lib. This avoids false
64 +# positives with plugins like Apache modules, which may have their own
65 +# SONAMEs but which don't matter for the purposes of this check.
66 +sub lib_soname_path {
68 + foreach my $path (@paths) {
69 + return 1 if $path =~ m%^(\.?/)?lib/[^/]+$%;
70 + return 1 if $path =~ m%^(\.?/)?usr/lib/[^/]+$%;
71 + return 1 if $path =~ m%^(\.?/)?usr/X11R6/lib/[^/]+$%;
75 +my @sonames = grep { lib_soname_path (@{$SONAME{$_}}) } keys %SONAME;
76 +tag "several-sonames-in-same-package", "@sonames" if @sonames > 1;
78 +# try to identify transition strings
80 +$base_pkg =~ s/c102\b//o;
81 +$base_pkg =~ s/c2a?\b//o;
82 +$base_pkg =~ s/\dg$//o;
83 +$base_pkg =~ s/-udeb$//o;
84 +$base_pkg =~ s/^lib64/lib/o;
87 +foreach my $expected_name (@sonames) {
88 + $expected_name =~ s/([0-9])\.so\./$1-/;
89 + $expected_name =~ s/\.so(\.|$)//o;
90 + $expected_name =~ s/_/-/o;
92 + if ((lc($expected_name) eq $pkg)
93 + || (lc($expected_name) eq $base_pkg)) {
99 +tag "package-name-doesnt-match-sonames", "@sonames"
100 + if @sonames && !$match_found;
102 # process all files in package
103 open(IN,"file-info") or fail("cannot find file-info for $type package $pkg");
105 @@ -175,13 +224,14 @@
108 if (!exists($NEEDED{$file}) && !defined($NEEDED{$file})) {
109 - if ($info =~ m/shared object/o) {
110 + if ($info =~ m/shared object/o && $file !~ m#^\./usr/lib/debug/#) {
111 tag "shared-lib-without-dependency-information", "$file";
113 # Some exceptions: files in /boot, /usr/lib/debug/*, named *-static or
114 # *.static, or *-static as package-name.
115 - use File::Basename;
116 - next if (dirname($file) eq './boot');
117 + next if ($file =~ m#^./boot/#);
118 + # klibc binaries appear to be static.
119 + next if ($KLIBC{$file});
120 # Location of debugging symbols:
121 next if ($file =~ m#^./usr/lib/debug/#);
122 next if ($file =~ /(\.|-)static$/);