Browse Source

Revert change on 1.14.0 from Aaron M. Ucko. Trim down duped entries only
when passing them to dpkg-query instead. Closes: #425641

Guillem Jover 17 years ago
parent
commit
48b9410809
3 changed files with 14 additions and 6 deletions
  1. 7 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 5 6
      scripts/dpkg-shlibdeps.pl

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2007-05-23  Guillem Jover  <guillem@debian.org>
+
+	Revert commit on 2007-04-28 by Aaron M. Ucko  <ucko@debian.org>.
+
+	* scripts/dpkg-shlibdeps.pl: Trim down duplicated files from @libfiles
+	only when passing it to dpkg-query.
+
 2007-05-23  Kylan Robinson  <Kylan_Robinson@selinc.com>
 
 	* scripts/dpkg-source.pl: Fix regex (/\.debian.tar/ ->

+ 2 - 0
debian/changelog

@@ -8,6 +8,8 @@ dpkg (1.14.4) UNRELEASED; urgency=low
     initially intended name. Closes: #425041
   * Fix loose regex in dpkg-source (/\.debian.tar/ -> /\.debian\.tar/).
     Thanks to Kylan Robinson. Closes: #425629
+  * Revert change on 1.14.0 from Aaron M. Ucko. Trim down duped entries only
+    when passing them to dpkg-query instead. Closes: #425641
 
   [ Updated dpkg translations ]
   * French (Frédéric Bothamy).

+ 5 - 6
scripts/dpkg-shlibdeps.pl

@@ -178,7 +178,7 @@ while( <CONF> ) {
 }
 close CONF;
 
-my (%rpaths, %format, %unique_libfiles);
+my (%rpaths, %format);
 my (@libfiles, @libname, @libsoname, @libfield, @libexec);
 for ($i=0;$i<=$#exec;$i++) {
     if (!isbin ($exec[$i])) { next; }
@@ -195,19 +195,15 @@ 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));
@@ -280,10 +276,13 @@ if ($#libfiles >= 0) {
     grep(s/\[\?\*/\\$&/g, @libname);
     defined(my $c= open(P,"-|")) || syserr(_g("cannot fork for dpkg --search"));
     if (!$c) {
+	my %seen_libfiles;
+	my @uniq_libfiles = grep !$seen_libfiles{$_}++, @libfiles;
+
 	close STDERR; # we don't need to see dpkg's errors
 	open STDERR, "> /dev/null";
 	$ENV{LC_ALL} = "C";
-	exec("dpkg", "--search", "--", @libfiles) or
+	exec("dpkg", "--search", "--", @uniq_libfiles) or
 	    syserr(_g("cannot exec dpkg"));
     }
     while (<P>) {