Browse Source

* Honor LD_LIBRARY_PATH in dpkg-shlibdeps. Fixes a regression
from 1.13.11 to .12.
* Don't recurse into package directories to search for local
shlibs files since it is obviously a waste of time. Based
on a suggestion by Steve Langasek. Closes: #338725

Frank Lichtenheld 20 years ago
parent
commit
e9851ad3e0
3 changed files with 28 additions and 3 deletions
  1. 7 0
      ChangeLog
  2. 5 0
      debian/changelog
  3. 16 3
      scripts/dpkg-shlibdeps.pl

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2006-01-27  Frank Lichtenheld  <djpig@debian.org>
+
+	* scripts/dpkg-shlibdeps.pl: Honor LD_LIBRARY_PATH when
+	searching for shared libraries.
+	* scripts/dpkg-shlibdeps.pl: Don't recurse into package
+	directories when searching for local shlibs files.
+
 2006-01-26  Zefram  <zefram@fysh.org>,
 	    Guillem Jover  <guillem@debian.org>
 

+ 5 - 0
debian/changelog

@@ -5,6 +5,11 @@ dpkg (1.13.13~) unstable; urgency=low
     Correct info in the control file.
   * Bump Standards-Version to 3.6.2 (no changes).
   * Fix typo in dpkg-architecture man page. Closes: #334330
+  * Honor LD_LIBRARY_PATH in dpkg-shlibdeps. Fixes a regression
+    from 1.13.11 to .12.
+  * Don't recurse into package directories to search for local
+    shlibs files since it is obviously a waste of time. Based
+    on a suggestion by Steve Langasek. Closes: #338725
 
   [ Christian Perrier ]
   * Updated Translations:

+ 16 - 3
scripts/dpkg-shlibdeps.pl

@@ -105,14 +105,26 @@ sub isbin {
 }
 
 my @librarypaths = qw( /lib /usr/lib /lib64 /usr/lib64 );
-my %librarypaths = map { $_ => 1 } @librarypaths;
+my %librarypaths = map { $_ => 'default' } @librarypaths;
+
+if ($ENV{LD_LIBRARY_PATH}) {
+    foreach (reverse split( /:/, $ENV{LD_LIBRARY_PATH} )) {
+	s,/+$,,;
+	unless (exists $librarypaths{$_}) {
+	    $librarypaths{$_} = 'env';
+	    unshift @librarypaths, $_;
+	}
+    }
+}
+
 open CONF, '</etc/ld.so.conf' or
     warn( "couldn't open /etc/ld.so.conf: $!" );
 while( <CONF> ) {
     next if /^\s*$/;
     chomp;
     s,/+$,,;
-    unless ($librarypaths{$_}++) {
+    unless (exists $librarypaths{$_}) {
+	$librarypaths{$_} = 'conf';
 	push @librarypaths, $_;
     }
 }
@@ -164,7 +176,8 @@ sub searchdir {
 	    if ( -f "$dir/$_/DEBIAN/shlibs" ) {
 		push(@curshlibs, "$dir/$_/DEBIAN/shlibs");
 		next;
-	    } elsif ( $_ !~ /^\./ && -d "$dir/$_" && ! -l "$dir/$_" ) {
+	    } elsif ( $_ !~ /^\./ && ! -e "$dir/$_/DEBIAN" &&
+		      -d "$dir/$_" && ! -l "$dir/$_" ) {
 		&searchdir("$dir/$_");
 	    }
 	}