From 95caa718f46388b618227d31828c8d15d0635913 Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 12 Apr 2023 12:33:38 +0100 Subject: postgres.eclass: die if no matching postgresql impl found This matches what we do in other eclasses like for python and ruby. It leads to a nicer error if e.g. manually using ebuild(1) rather than emerge(1) and deps aren't satisfied, or forgot to set POSTGRES_TARGETS locally, etc. Signed-off-by: Sam James --- eclass/postgres.eclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'eclass/postgres.eclass') diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass index e94ab56a40ae..c3dc24e9db52 100644 --- a/eclass/postgres.eclass +++ b/eclass/postgres.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: postgres.eclass @@ -150,6 +150,10 @@ postgres_pkg_setup() { export PG_SLOT=${best_slot} export PG_CONFIG=$(type -P pg_config${best_slot//./}) + if [[ -z ${PG_CONFIG} ]] ; then + die "Could not find pg_config for ${PG_SLOT}. Is dev-db/postgresql:${PG_SLOT} installed?" + fi + local pg_pkg_config_path="$(${PG_CONFIG} --libdir)/pkgconfig" if [[ -n "${PKG_CONFIG_PATH}" ]]; then export PKG_CONFIG_PATH="${pg_pkg_config_path}:${PKG_CONFIG_PATH}" -- cgit v1.2.3