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

pg_wrapper: If libreadline is installed, LD_PRELOAD this for "psql", to

avoid using the rather broken libedit. We need to build the postgresql-X.Y
packages against libedit for license reasons (#603599), but as libreadline
has a drop-in compatible ABI, this works around the licensing
restrictions. Thanks to Andreas Barth for working this out! Add a
recommends to libreadline6. (Closes: #608442, #607907, #607109, #611918)
parent 4c26c811
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,12 @@ postgresql-common (114) UNRELEASED; urgency=low
(Closes: #607946)
* testsuite: Take new unified init script into account when stopping
existing clusters. Thanks Steve Beattie! (LP: #712200)
* pg_wrapper: If libreadline is installed, LD_PRELOAD this for "psql", to
avoid using the rather broken libedit. We need to build the postgresql-X.Y
packages against libedit for license reasons (#603599), but as libreadline
has a drop-in compatible ABI, this works around the licensing
restrictions. Thanks to Andreas Barth for working this out! Add a
recommends to libreadline6. (Closes: #608442, #607907, #607109, #611918)
-- Martin Pitt <mpitt@debian.org> Sun, 05 Dec 2010 14:03:33 +0100
......
......@@ -31,7 +31,7 @@ Description: PostgreSQL database-cluster manager
Package: postgresql-client-common
Architecture: all
Depends: ${misc:Depends}
Recommends: lsb-release
Recommends: lsb-release, libreadline6
Description: manager for multiple PostgreSQL client versions
The postgresql-client-common package provides a structure under which
multiple versions of PostgreSQL client programs may be installed at
......
......@@ -94,7 +94,17 @@ unless ($version) {
}
error 'Invalid PostgreSQL cluster version' unless -d "/usr/lib/postgresql/$version";
my $cmd = get_program_path (((split '/', $0)[-1]), $version);
my $cmdname = (split '/', $0)[-1];
my $cmd = get_program_path ($cmdname, $version);
# libreadline is a lot better than libedit, so prefer that
if ($cmdname eq 'psql') {
my @readlines = sort(</lib/libreadline.so.*>);
if (@readlines) {
$ENV{'LD_PRELOAD'} = ($ENV{'LD_PRELOAD'} or '') . ':' . $readlines[-1];
}
}
error 'pg_wrapper: invalid command name' unless $cmd;
unshift @ARGV, $cmd;
exec @ARGV;
......
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