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 3/4] postgres-multi.eclass: stop using which(1)
Date: Mon, 05 Dec 2022 10:52:48
Message-Id: 20221205105153.634699-3-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-multi.eclass | 6 +++---
7 1 file changed, 3 insertions(+), 3 deletions(-)
8
9 diff --git a/eclass/postgres-multi.eclass b/eclass/postgres-multi.eclass
10 index c73f33c71b49..9dcf22e64a12 100644
11 --- a/eclass/postgres-multi.eclass
12 +++ b/eclass/postgres-multi.eclass
13 @@ -1,4 +1,4 @@
14 -# Copyright 1999-2021 Gentoo Authors
15 +# Copyright 1999-2022 Gentoo Authors
16 # Distributed under the terms of the GNU General Public License v2
17
18 inherit multibuild postgres
19 @@ -58,7 +58,7 @@ export _POSTGRES_INTERSECT_SLOTS=( )
20 _postgres-multi_multibuild_wrapper() {
21 debug-print-function ${FUNCNAME} "${@}"
22 export PG_SLOT=${MULTIBUILD_VARIANT}
23 - export PG_CONFIG=$(which pg_config${MULTIBUILD_VARIANT//./})
24 + export PG_CONFIG=$(type -P pg_config${MULTIBUILD_VARIANT//./})
25 if [[ -n ${PKG_CONFIG_PATH} ]] ; then
26 PKG_CONFIG_PATH="$(${PG_CONFIG} --libdir)/pkgconfig:${PKG_CONFIG_PATH}"
27 else
28 @@ -139,7 +139,7 @@ postgres-multi_src_prepare() {
29 # Portage, but won't be caught by /usr/bin/ebuild)
30 local slot
31 for slot in ${_POSTGRES_INTERSECT_SLOTS[@]} ; do
32 - if [[ -z $(which pg_config${slot/.} 2> /dev/null) ]] ; then
33 + if [[ -z $(type -P pg_config${slot/.} 2> /dev/null) ]] ; then
34 eerror
35 eerror "postgres_targets_postgres${slot/.} use flag is enabled, but hasn't been emerged."
36 eerror
37 --
38 2.38.1