From d8f54ad4c26dff8367c9cd975097ca4915759c49 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 27 Apr 2007 22:59:11 +0000 Subject: [PATCH] Speed up dpkg-shlibdeps by avoiding doing a dpkg-query for duped libraries. Thanks to Aaron M. Ucko. Closes: #421290 --- ChangeLog | 5 +++++ debian/changelog | 2 ++ scripts/dpkg-shlibdeps.pl | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8eb1777c..872eaf75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-28 Aaron M. Ucko + + * scripts/dpkg-shlibdeps.pl (unique_libfiles): New variable. Do not + track duped libraries already on it. + 2007-04-11 Guillem Jover * scripts/dpkg-parsechangelog.pl: Use static and warnings. Declare diff --git a/debian/changelog b/debian/changelog index 9023005a..3c65de5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -62,6 +62,8 @@ dpkg (1.14.0) UNRELEASED; urgency=low Thanks to Martin Weis. * Properly sort Uploaders field in generated .dsc files. * Reorder a bit fields in output files. + * Speed up dpkg-shlibdeps by avoiding doing a dpkg-query for duped + libraries. Thanks to Aaron M. Ucko. Closes: #421290 [ Updated dpkg translations ] * Romanian (Eddy Petri?or). diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index a548210f..7da42b77 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -178,7 +178,7 @@ while( ) { } 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; } @@ -195,15 +195,19 @@ for ($i=0;$i<=$#exec;$i++) { $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+)$,; warning(sprintf(_g("format of 'NEEDED %s' not recognized"), $1)); -- 2.39.5