Skip to content
Snippets Groups Projects
Commit f43ad7d2 authored by Martin Pitt's avatar Martin Pitt
Browse files

pg_wrapper: The previous multiarch globbing was wrong, as it looked for

the architecture in uname() (which doesn't work on i386, where uname says
i686). Now get the multiarch library path from whereever psql expects
libedit.so to be, so that this even works if you install postgresql-client
for a foreign architecture.
parent 3789528e
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,11 @@ postgresql-common (124) UNRELEASED; urgency=low
the latter was reported to not work on some systems.
* pg_ctlcluster: Use PgCommon::check_pidfile_running and drop duplicated
code.
* pg_wrapper: The previous multiarch globbing was wrong, as it looked for
the architecture in uname() (which doesn't work on i386, where uname says
i686). Now get the multiarch library path from whereever psql expects
libedit.so to be, so that this even works if you install postgresql-client
for a foreign architecture.
-- Martin Pitt <mpitt@debian.org> Fri, 07 Oct 2011 19:04:19 +0200
......
......@@ -102,9 +102,21 @@ my $cmd = get_program_path ($cmdname, $version);
# libreadline is a lot better than libedit, so prefer that
if ($cmdname eq 'psql') {
my @readlines;
my $arch = (POSIX::uname)[4];
push @readlines, sort(</lib/$arch-*/libreadline.so.*>);
push @readlines, sort(</lib/libreadline.so.*>);
# non-multiarch path
@readlines = sort(</lib/libreadline.so.?>);
unless (@readlines) {
# get multiarch dir for our architecture
if (open PS, '-|', '/usr/bin/ldd', $cmd) {
my $out;
read PS, $out, 10000;
close PS;
my ($lib_path) = $out =~ m!(/lib/.*)/libedit.so!;
@readlines = sort(<$lib_path/libreadline.so.?>);
}
}
if (@readlines) {
$ENV{'LD_PRELOAD'} = ($ENV{'LD_PRELOAD'} or '') . ':' . $readlines[-1];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment