]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Add MacPorts support to src/test/ldap tests.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 13 Apr 2023 14:32:51 +0000 (10:32 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 13 Apr 2023 14:32:51 +0000 (10:32 -0400)
Previously the test knew how to find an OpenLDAP installation at the
paths used by Homebrew.  Add the MacPorts paths too.

This back-patches the v12-era commit aa1419e63 into v11, in
preparation for spinning up a buildfarm animal that requires it.

Author: Thomas Munro
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/CA%2BhUKGKrjGS7sO4jc53gp3qipCtEvThtdP_%3DzoixgX5ZBq4Nbw%40mail.gmail.com
Discussion: https://postgr.es/m/1239437.1681364592@sss.pgh.pa.us

src/test/ldap/README
src/test/ldap/t/001_auth.pl

index 4d641f92840268598174b5b8cc936968628d1472..826b15373f22c95636a11b9cbbd0be59e9109a83 100644 (file)
@@ -49,4 +49,4 @@ and net/openldap24-server.)
 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
 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.
index 60a41b844a63c181e271e89ca95a9c4ec5d93bf6..2019674ed4d0f02a754a37b00b0cd8176c182df2 100644 (file)
@@ -17,11 +17,18 @@ my ($slapd, $ldap_bin_dir, $ldap_schema_dir);
 
 $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';
        $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')
 {
        $slapd           = '/usr/sbin/slapd';