Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: pgsql-bugs@g.o, base-system@g.o, toolchain@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH 4/4] postgres.eclass: stop using which(1)
Date: Mon, 05 Dec 2022 10:53:04
Message-Id: 20221205105153.634699-4-sam@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: stop using which(1) by Sam James
1 It's non-portable and we're looking to remove it from @system.
2
3 Bug: https://bugs.gentoo.org/646588
4 Signed-off-by: Sam James <sam@g.o>
5 ---
6 eclass/postgres.eclass | 4 ++--
7 1 file changed, 2 insertions(+), 2 deletions(-)
8
9 diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
10 index 3ae1c49adc68..8e204e2ade8c 100644
11 --- a/eclass/postgres.eclass
12 +++ b/eclass/postgres.eclass
13 @@ -106,7 +106,7 @@ postgres_check_slot() {
14 fi
15
16 # Don't die because we can't run postgresql-config during pretend.
17 - [[ "$EBUILD_PHASE" = "pretend" && -z "$(which postgresql-config 2> /dev/null)" ]] \
18 + [[ "$EBUILD_PHASE" = "pretend" && -z "$(type -P postgresql-config 2> /dev/null)" ]] \
19 && return 0
20
21 if has $(postgresql-config show 2> /dev/null) "${POSTGRES_COMPAT[@]}"; then
22 @@ -148,7 +148,7 @@ postgres_pkg_setup() {
23 fi
24
25 export PG_SLOT=${best_slot}
26 - export PG_CONFIG=$(which pg_config${best_slot//./})
27 + export PG_CONFIG=$(type -P pg_config${best_slot//./})
28
29 local pg_pkg_config_path="$(${PG_CONFIG} --libdir)/pkgconfig"
30 if [[ -n "${PKG_CONFIG_PATH}" ]]; then
31 --
32 2.38.1