Commit aa1419e6 authored by Thomas Munro's avatar Thomas Munro

Add MacPorts support to src/test/ldap tests.

Previously the test knew how to find an OpenLDAP installation at the
paths used by Homebrew.  Add the MacPorts paths too.

Author: Thomas Munro
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/CA%2BhUKGKrjGS7sO4jc53gp3qipCtEvThtdP_%3DzoixgX5ZBq4Nbw%40mail.gmail.com
parent f7111f72
...@@ -49,4 +49,4 @@ and net/openldap24-server.) ...@@ -49,4 +49,4 @@ and net/openldap24-server.)
macOS: We do not recommend trying to use the Apple-provided version of macOS: We do not recommend trying to use the Apple-provided version of
OpenLDAP; it's very old, plus Apple seem to have changed the launching OpenLDAP; it's very old, plus Apple seem to have changed the launching
conventions for slapd. The paths in the test file are set on the conventions for slapd. The paths in the test file are set on the
assumption that you installed OpenLDAP using Homebrew. assumption that you installed OpenLDAP using Homebrew or MacPorts.
...@@ -17,11 +17,18 @@ my ($slapd, $ldap_bin_dir, $ldap_schema_dir); ...@@ -17,11 +17,18 @@ my ($slapd, $ldap_bin_dir, $ldap_schema_dir);
$ldap_bin_dir = undef; # usually in PATH $ldap_bin_dir = undef; # usually in PATH
if ($^O eq 'darwin') if ($^O eq 'darwin' && -d '/usr/local/opt/openldap')
{ {
# typical paths for Homebrew
$slapd = '/usr/local/opt/openldap/libexec/slapd'; $slapd = '/usr/local/opt/openldap/libexec/slapd';
$ldap_schema_dir = '/usr/local/etc/openldap/schema'; $ldap_schema_dir = '/usr/local/etc/openldap/schema';
} }
elsif ($^O eq 'darwin' && -d '/opt/local/etc/openldap')
{
# typical paths for MacPorts
$slapd = '/opt/local/libexec/slapd';
$ldap_schema_dir = '/opt/local/etc/openldap/schema';
}
elsif ($^O eq 'linux') elsif ($^O eq 'linux')
{ {
$slapd = '/usr/sbin/slapd'; $slapd = '/usr/sbin/slapd';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment