From 0a3f6436bcdfed21e7edc0c1c8c60322b590298b Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Thu, 22 Nov 2007 12:22:14 +0100 Subject: [PATCH] Dpkg::Shlibs: Always consider all paths from LD_LIBRARY_PATH Paths listed in LD_LIBRARY_PATH were not added at the beginning of the search path if they were part of the default search paths. Remove this restriction so that it's possible to change the search order in default paths by using this variable. --- ChangeLog | 5 ++++- scripts/Dpkg/Shlibs.pm | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5eb5dd8..42e0c4c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,10 @@ not found by "dpkg -S", try the same on the realpath of the library as fallback before deciding that it's a library being built. - + * scripts/Dpkg/Shlibs.pm: Always add paths from LD_LIBRARY_PATH + at the beginning of the list of path to search, even if they + are already listed (one might want to use LD_LIBRARY_PATH to + change the search order). 2007-11-21 Raphael Hertzog diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm index 28225dfc..03916bb5 100644 --- a/scripts/Dpkg/Shlibs.pm +++ b/scripts/Dpkg/Shlibs.pm @@ -35,9 +35,7 @@ our @librarypaths = (DEFAULT_LIBRARY_PATH); if ($ENV{LD_LIBRARY_PATH}) { foreach my $path (reverse split( /:/, $ENV{LD_LIBRARY_PATH} )) { $path =~ s{/+$}{}; - unless (scalar grep { $_ eq $path } @librarypaths) { - unshift @librarypaths, $path; - } + unshift @librarypaths, $path; } } -- 2.39.5