From 97420f523c7a30774e027ef05c10a9d134178e52 Mon Sep 17 00:00:00 2001 From: James Nugent Date: Tue, 27 Dec 2016 15:10:20 -0600 Subject: [PATCH] provider/postgres: Allow brew installed postgresql This commit modifies the GNUmakefile used for starting PostgreSQL for testing purposes to prefer the version installed via Homebrew, followed by the version installed via MacPorts. POSTGRES, PSQL and INITDB may be overriden as Make variables if neither of these package management systems is in use. --- builtin/providers/postgresql/GNUmakefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/providers/postgresql/GNUmakefile b/builtin/providers/postgresql/GNUmakefile index 4d9f2875b4..e93005de98 100644 --- a/builtin/providers/postgresql/GNUmakefile +++ b/builtin/providers/postgresql/GNUmakefile @@ -5,14 +5,15 @@ # may change in the future and is likely not required when doing # non-delete related operations. But for now it is. -POSTGRES?=/opt/local/lib/postgresql96/bin/postgres -PSQL?=/opt/local/lib/postgresql96/bin/psql +POSTGRES?=$(wildcard /usr/local/bin/postgres /opt/local/lib/postgresql96/bin/postgres) +PSQL?=$(wildcard /usr/local/bin/psql /opt/local/lib/postgresql96/bin/psql) +INITDB?=$(wildcard /usr/local/bin/initdb /opt/local/lib/postgresql96/bin/initdb) PGDATA?=$(GOPATH)/src/github.com/hashicorp/terraform/builtin/providers/postgresql/data initdb:: echo "" > pwfile - /opt/local/lib/postgresql96/bin/initdb --no-locale -U postgres -A md5 --pwfile=pwfile -D $(PGDATA) + $(INITDB) --no-locale -U postgres -A md5 --pwfile=pwfile -D $(PGDATA) startdb:: 2>&1 \