Package: dpkg-dev Version: 1.13.25 Severity: normal File: /usr/bin/dpkg-shlibdeps Tags: patch
I have found that running dpkg-shlibdeps (typically via dh_shlibdeps) on a package containing a large number of executables or shared libraries can take a really long time (27 minutes in one test case!), particularly on systems with many packages installed (resulting in an expensive dpkg-query run). The culprit appears to be that dpkg-shlibdeps accumulates a (potentially lengthy) list of needed libraries with no concern for avoiding redundancy, which can be considerable. (At the very least, everything tends to require /lib/libc.so.6 and /lib/ld-linux.so.2 or the equivalent, and executables from the same package generally have similar if not identical dependencies.) As such, could you please consider applying the following patch? Invoking the corresponding version of dpkg-shlibdeps on the aforementioned 27-minute test case brings the runtime down to one minute (from a cold cache) with no change in the generated substvars. Thanks! --- /usr/bin/dpkg-shlibdeps 2007-01-01 18:00:54.000000000 -0500 +++ /home/amu/tmp/dpkg-shlibdeps 2007-04-27 11:14:34.000000000 -0400 @@ -165,7 +165,7 @@ } close CONF; -my (%rpaths, %format); +my (%rpaths, %format, %unique_libfiles); my (@libfiles, @libname, @libsoname, @libfield, @libexec); for ($i=0;$i<=$#exec;$i++) { if (!isbin ($exec[$i])) { next; } @@ -182,15 +182,19 @@ $format{$exec[$i]} = $1; } elsif (m,^\s*NEEDED\s+,) { if (m,^\s*NEEDED\s+((\S+)\.so\.(\S+))$,) { + next if exists $unique_libfiles{$1}; push(@libname,$2); push(@libsoname,$3); push(@libfield,$execfield[$i]); push(@libfiles,$1); push(@libexec,$exec[$i]); + $unique_libfiles{$1} = 1; } elsif (m,^\s*NEEDED\s+((\S+)-(\S+)\.so)$,) { + next if exists $unique_libfiles{$1}; push(@libname,$2); push(@libsoname,$3); push(@libfield,$execfield[$i]); push(@libfiles,$1); push(@libexec,$exec[$i]); + $unique_libfiles{$1} = 1; } else { m,^\s*NEEDED\s+(\S+)$,; &warn(sprintf(_g("format of \`NEEDED %s' not recognized"), $1)); -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.20.7 (SMP w/2 CPU cores) Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/bash Versions of packages dpkg-dev depends on: ii binutils 2.17cvs20070426-1 The GNU assembler, linker and bina ii cpio 2.7-2 GNU cpio -- a program to manage ar ii dpkg 1.13.25 package maintenance system for Deb ii make 3.81-3 The GNU version of the "make" util ii patch 2.5.9-4 Apply a diff file to an original ii perl [perl5] 5.8.8-7 Larry Wall's Practical Extraction ii perl-modules 5.8.8-7 Core Perl modules Versions of packages dpkg-dev recommends: ii bcc [c-compiler] 0.16.14-1.4 16-bit x86 C compiler ii bzip2 1.0.3-6 high-quality block-sorting file co ii gcc [c-compiler] 4:4.1.1-15 The GNU C compiler ii gcc-3.3 [c-compiler] 1:3.3.6-15 The GNU C compiler ii gcc-3.4 [c-compiler] 3.4.6-5 The GNU C compiler ii gcc-4.0 [c-compiler] 4.0.3-7 The GNU C compiler ii gcc-4.1 [c-compiler] 4.1.1-21 The GNU C compiler -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]