Procházet zdrojové kódy

Speed up dpkg-shlibdeps by avoiding doing a dpkg-query for duped
libraries. Thanks to Aaron M. Ucko. Closes: #421290

Guillem Jover před 19 roky
rodič
revize
d8f54ad4c2
3 změnil soubory, kde provedl 12 přidání a 1 odebrání
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 5 1
      scripts/dpkg-shlibdeps.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2007-04-28  Aaron M. Ucko  <ucko@debian.org>
+
+	* scripts/dpkg-shlibdeps.pl (unique_libfiles): New variable. Do not
+	track duped libraries already on it.
+
 2007-04-11  Guillem Jover  <guillem@debian.org>
 
 	* scripts/dpkg-parsechangelog.pl: Use static and warnings. Declare

+ 2 - 0
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).

+ 5 - 1
scripts/dpkg-shlibdeps.pl

@@ -178,7 +178,7 @@ while( <CONF> ) {
 }
 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));