summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-04-12 12:33:38 +0100
committerSam James <sam@gentoo.org>2023-04-17 22:14:32 +0100
commit95caa718f46388b618227d31828c8d15d0635913 (patch)
tree6d548253d2f0a2cd9a367a068affd8b03b6f6d9f /eclass/postgres.eclass
parentapp-emulation/wine-proton: move gmp dep behind ssl (diff)
downloadgentoo-95caa718f46388b618227d31828c8d15d0635913.tar.gz
gentoo-95caa718f46388b618227d31828c8d15d0635913.tar.bz2
gentoo-95caa718f46388b618227d31828c8d15d0635913.zip
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 <sam@gentoo.org>
Diffstat (limited to 'eclass/postgres.eclass')
-rw-r--r--eclass/postgres.eclass6
1 files changed, 5 insertions, 1 deletions
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}"