From: Frank Lichtenheld Date: Fri, 27 Jan 2006 00:11:17 +0000 (+0000) Subject: * Honor LD_LIBRARY_PATH in dpkg-shlibdeps. Fixes a regression X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9851ad3e0562fbe53a535d32bc8c1d0a32c929e;p=dpkg * 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 --- diff --git a/ChangeLog b/ChangeLog index 6ec9cc33..68468ed7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-01-27 Frank Lichtenheld + + * 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 , Guillem Jover diff --git a/debian/changelog b/debian/changelog index a80d59d7..c76a1898 100644 --- a/debian/changelog +++ b/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: diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 382db16c..e6c26cd4 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/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, ' ) { 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/$_"); } }