public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: stop using which(1)
@ 2022-12-05 10:51 Sam James
  2022-12-05 10:51 ` [gentoo-dev] [PATCH 2/4] usr-ldscript.eclass: " Sam James
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sam James @ 2022-12-05 10:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: pgsql-bugs, base-system, toolchain, Sam James

It's non-portable and we're looking to remove it from @system.

Bug: https://bugs.gentoo.org/487696
Bug: https://bugs.gentoo.org/646588
Signed-off-by: Sam James <sam@gentoo.org>
---
 eclass/toolchain-funcs.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index fea2a6885c46..6fa103fc110e 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -609,7 +609,7 @@ tc-ld-force-bfd() {
 	# to its value (like multilib).  #545218
 	local ld=$(tc-getLD "$@")
 	local bfd_ld="${ld%% *}.bfd"
-	local path_ld=$(which "${bfd_ld}" 2>/dev/null)
+	local path_ld=$(type -P "${bfd_ld}" 2>/dev/null)
 	[[ -e ${path_ld} ]] && export LD=${bfd_ld}
 
 	# Set up LDFLAGS to select bfd based on the gcc / clang version.
@@ -1154,7 +1154,7 @@ gen_usr_ldscript() {
 		# If they're using gold, manually invoke the old bfd. #487696
 		local d="${T}/bfd-linker"
 		mkdir -p "${d}"
-		ln -sf $(which ${CHOST}-ld.bfd) "${d}"/ld
+		ln -sf $(type -P ${CHOST}-ld.bfd) "${d}"/ld
 		flags+=( -B"${d}" )
 	fi
 	output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 2/4] usr-ldscript.eclass: stop using which(1)
  2022-12-05 10:51 [gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: stop using which(1) Sam James
@ 2022-12-05 10:51 ` Sam James
  2022-12-05 10:51 ` [gentoo-dev] [PATCH 3/4] postgres-multi.eclass: " Sam James
  2022-12-05 10:51 ` [gentoo-dev] [PATCH 4/4] postgres.eclass: " Sam James
  2 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-12-05 10:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: pgsql-bugs, base-system, toolchain, Sam James

It's non-portable and we're looking to remove it from @system.

Bug: https://bugs.gentoo.org/646588
Signed-off-by: Sam James <sam@gentoo.org>
---
 eclass/usr-ldscript.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass
index a8229ed2ac2e..c821abd60846 100644
--- a/eclass/usr-ldscript.eclass
+++ b/eclass/usr-ldscript.eclass
@@ -70,7 +70,7 @@ gen_usr_ldscript() {
 		# If they're using gold, manually invoke the old bfd. #487696
 		local d="${T}/bfd-linker"
 		mkdir -p "${d}"
-		ln -sf $(which ${CHOST}-ld.bfd) "${d}"/ld
+		ln -sf $(type -P ${CHOST}-ld.bfd) "${d}"/ld
 		flags+=( -B"${d}" )
 	fi
 	output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 3/4] postgres-multi.eclass: stop using which(1)
  2022-12-05 10:51 [gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: stop using which(1) Sam James
  2022-12-05 10:51 ` [gentoo-dev] [PATCH 2/4] usr-ldscript.eclass: " Sam James
@ 2022-12-05 10:51 ` Sam James
  2022-12-05 10:51 ` [gentoo-dev] [PATCH 4/4] postgres.eclass: " Sam James
  2 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-12-05 10:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: pgsql-bugs, base-system, toolchain, Sam James

It's non-portable and we're looking to remove it from @system.

Bug: https://bugs.gentoo.org/646588
Signed-off-by: Sam James <sam@gentoo.org>
---
 eclass/postgres-multi.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/postgres-multi.eclass b/eclass/postgres-multi.eclass
index c73f33c71b49..9dcf22e64a12 100644
--- a/eclass/postgres-multi.eclass
+++ b/eclass/postgres-multi.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 inherit multibuild postgres
@@ -58,7 +58,7 @@ export _POSTGRES_INTERSECT_SLOTS=( )
 _postgres-multi_multibuild_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 	export PG_SLOT=${MULTIBUILD_VARIANT}
-	export PG_CONFIG=$(which pg_config${MULTIBUILD_VARIANT//./})
+	export PG_CONFIG=$(type -P pg_config${MULTIBUILD_VARIANT//./})
 	if [[ -n ${PKG_CONFIG_PATH} ]] ; then
 		PKG_CONFIG_PATH="$(${PG_CONFIG} --libdir)/pkgconfig:${PKG_CONFIG_PATH}"
 	else
@@ -139,7 +139,7 @@ postgres-multi_src_prepare() {
 	# Portage, but won't be caught by /usr/bin/ebuild)
 	local slot
 	for slot in ${_POSTGRES_INTERSECT_SLOTS[@]} ; do
-		if [[ -z $(which pg_config${slot/.} 2> /dev/null) ]] ; then
+		if [[ -z $(type -P pg_config${slot/.} 2> /dev/null) ]] ; then
 			eerror
 			eerror "postgres_targets_postgres${slot/.} use flag is enabled, but hasn't been emerged."
 			eerror
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 4/4] postgres.eclass: stop using which(1)
  2022-12-05 10:51 [gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: stop using which(1) Sam James
  2022-12-05 10:51 ` [gentoo-dev] [PATCH 2/4] usr-ldscript.eclass: " Sam James
  2022-12-05 10:51 ` [gentoo-dev] [PATCH 3/4] postgres-multi.eclass: " Sam James
@ 2022-12-05 10:51 ` Sam James
  2 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-12-05 10:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: pgsql-bugs, base-system, toolchain, Sam James

It's non-portable and we're looking to remove it from @system.

Bug: https://bugs.gentoo.org/646588
Signed-off-by: Sam James <sam@gentoo.org>
---
 eclass/postgres.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index 3ae1c49adc68..8e204e2ade8c 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -106,7 +106,7 @@ postgres_check_slot() {
 	fi
 
 	# Don't die because we can't run postgresql-config during pretend.
-	[[ "$EBUILD_PHASE" = "pretend" && -z "$(which postgresql-config 2> /dev/null)" ]] \
+	[[ "$EBUILD_PHASE" = "pretend" && -z "$(type -P postgresql-config 2> /dev/null)" ]] \
 		&& return 0
 
 	if has $(postgresql-config show 2> /dev/null) "${POSTGRES_COMPAT[@]}"; then
@@ -148,7 +148,7 @@ postgres_pkg_setup() {
 	fi
 
 	export PG_SLOT=${best_slot}
-	export PG_CONFIG=$(which pg_config${best_slot//./})
+	export PG_CONFIG=$(type -P pg_config${best_slot//./})
 
 	local pg_pkg_config_path="$(${PG_CONFIG} --libdir)/pkgconfig"
 	if [[ -n "${PKG_CONFIG_PATH}" ]]; then
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-05 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05 10:51 [gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: stop using which(1) Sam James
2022-12-05 10:51 ` [gentoo-dev] [PATCH 2/4] usr-ldscript.eclass: " Sam James
2022-12-05 10:51 ` [gentoo-dev] [PATCH 3/4] postgres-multi.eclass: " Sam James
2022-12-05 10:51 ` [gentoo-dev] [PATCH 4/4] postgres.eclass: " Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox