The branch, dpkg-shlibdeps-buxy has been updated
       via  ee9f8c8ae478206bda6bdab82256fb309e5d314f (commit)
       via  6e02b2ef46aadde5ce142bb42b58e3165253eb58 (commit)
      from  2e229f0686d243d31dea34e4664200f6c90e3333 (commit)


- Shortlog ------------------------------------------------------------
ee9f8c8 dpkg-shlibdeps also fails when it can't find the library
6e02b2e Let dpkg-shlibdeps be smarter about missing symbols

Summary of changes:
 scripts/Dpkg/Shlibs/Objdump.pm              |   19 ++++++++++++++++++-
 scripts/dpkg-shlibdeps.pl                   |   18 +++++++++++-------
 scripts/t/200_Dpkg_Shlibs/objdump.glib-ia64 |    3 +++
 scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.3 |    3 +++
 scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.6 |    3 +++
 5 files changed, 38 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit ee9f8c8ae478206bda6bdab82256fb309e5d314f
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date:   Mon Sep 24 17:57:44 2007 +0200

    dpkg-shlibdeps also fails when it can't find the library

diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index e1f791b..239e00a 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -97,7 +97,7 @@ foreach my $file (keys %exec) {
     my %libfiles;
     foreach my $soname (@sonames) {
        my $file = my_find_library($soname, $obj->{RPATH}, $obj->{format});
-       warning("Couldn't find library $soname.") unless defined($file);
+       failure(sprintf(_g("couldn't find library %s (note: only packages with 
'shlibs' files are looked into)."), $soname)) unless defined($file);
        $libfiles{$file} = $soname if defined($file);
     }
     my $file2pkg = find_packages(keys %libfiles);

commit 6e02b2ef46aadde5ce142bb42b58e3165253eb58
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date:   Mon Sep 24 17:26:24 2007 +0200

    Let dpkg-shlibdeps be smarter about missing symbols
    
    dpkg-shlibdeps complains about missing symbols only for executables
    (as defined by the ELF type) and public libraries (as defined by the
    ELF type and the existence of a SONAME). This avoids many warnings
    for perl modules and python modules.

diff --git a/scripts/Dpkg/Shlibs/Objdump.pm b/scripts/Dpkg/Shlibs/Objdump.pm
index 9d69070..e08699d 100644
--- a/scripts/Dpkg/Shlibs/Objdump.pm
+++ b/scripts/Dpkg/Shlibs/Objdump.pm
@@ -141,7 +141,7 @@ sub _read {
     $self->{file} = $file;
 
     local $ENV{LC_ALL} = 'C';
-    open(my $objdump, "-|", "objdump", "-w", "-p", "-T", $file)
+    open(my $objdump, "-|", "objdump", "-w", "-f", "-p", "-T", $file)
        || syserr(sprintf(_g("Can't execute objdump: %s"), $!));
     my $ret = $self->_parse($objdump);
     close($objdump);
@@ -190,6 +190,12 @@ sub _parse {
        } elsif ($section eq "none") {
            if (/^\s*\S+:\s*file\s+format\s+(\S+)\s*$/) {
                $self->{format} = $1;
+           } elsif (/^architecture:\s*\S+,\s*flags:\s*\S+\s*$/) {
+               # Parse 2 lines of "-f"
+               # architecture: i386, flags 0x00000112:
+               # EXEC_P, HAS_SYMS, D_PAGED
+               # start address 0x08049b50
+               $self->{flags}{$_} = 1 foreach (split(/,\s*/, <$fh>));
            }
        }
     }
@@ -314,4 +320,15 @@ sub get_needed_libraries {
     return @{$self->{NEEDED}};
 }
 
+sub is_executable {
+    my $self = shift;
+    return exists $self->{flags}{EXEC_P} and $self->{flags}{EXEC_P};
+}
+
+sub is_public_library {
+    my $self = shift;
+    return exists $self->{flags}{DYNAMIC} and $self->{flags}{DYNAMIC}
+       and exists $self->{SONAME} and $self->{SONAME};
+}
+
 1;
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index f3117e2..e1f791b 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -177,12 +177,16 @@ foreach my $file (keys %exec) {
        } else {
            my $syminfo = $dumplibs_wo_symfile->locate_symbol($name);
            if (not defined($syminfo)) {
-               my $print_name = $name;
-               # Drop the default suffix for readability
-               $print_name =~ s/[EMAIL PROTECTED]//;
-               warning(sprintf(
-                   _g("symbol %s used by %s found in none of the libraries."),
-                   $print_name, $file)) unless $sym->{weak};
+               # Complain about missing symbols only for executables
+               # and public libraries
+               if ($obj->is_executable() or $obj->is_public_library()) {
+                   my $print_name = $name;
+                   # Drop the default suffix for readability
+                   $print_name =~ s/[EMAIL PROTECTED]//;
+                   warning(sprintf(
+                       _g("symbol %s used by %s found in none of the 
libraries."),
+                       $print_name, $file)) unless $sym->{weak};
+               }
            } else {
                $used_sonames{$syminfo->{soname}}++;
            }
diff --git a/scripts/t/200_Dpkg_Shlibs/objdump.glib-ia64 
b/scripts/t/200_Dpkg_Shlibs/objdump.glib-ia64
index 1b3d987..a3ff4d8 100644
--- a/scripts/t/200_Dpkg_Shlibs/objdump.glib-ia64
+++ b/scripts/t/200_Dpkg_Shlibs/objdump.glib-ia64
@@ -1,5 +1,8 @@
 
 /usr/lib/libglib-2.0.so.0:     file format elf64-little
+architecture: ia64-elf64, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x000000000002dc40
 
 Program Header:
     LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 
0x0000000000000000 align 2**16
diff --git a/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.3 
b/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.3
index 2eb8ae3..e761051 100644
--- a/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.3
+++ b/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.3
@@ -1,5 +1,8 @@
 
 /lib/libc.so.6:     file format elf32-i386
+architecture: i386, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x000161b0
 
 Program Header:
     PHDR off    0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2
diff --git a/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.6 
b/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.6
index 7efee24..ba68d1c 100644
--- a/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.6
+++ b/scripts/t/200_Dpkg_Shlibs/objdump.libc6-2.6
@@ -1,5 +1,8 @@
 
 /lib/libc.so.6:     file format elf32-i386
+architecture: i386, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x000161b0
 
 Program Header:
     PHDR off    0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to