Both toolchain_pkg_postinst and toolchain_pkg_postrm call the portageq ebuild helper (indirectly, via gcc-config) which is Portage specific. Policy reference: https://projects.gentoo.org/pms/8/pms.html#x1-13700012.3.17
gcc-config contains the following three calls to "portageq envvar": ABI=$(portageq envvar DEFAULT_ABI 2>/dev/null) GENTOO_LIBDIR=$(portageq envvar LIBDIR_"${ABI}" 2>/dev/null) CHOST=$(portageq envvar CHOST 2>/dev/null) All these variables should exist in the ebuild environment, so the script could do something like this: ABI=${DEFAULT_ABI:-$(portageq envvar DEFAULT_ABI)}
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=6d83aec7a8d26035d81b1cafdf007135aa4ea094 commit 6d83aec7a8d26035d81b1cafdf007135aa4ea094 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2023-05-14 15:45:32 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-05-14 17:24:32 +0000 gcc-config: Don't call portageq if the variable is already set Bug: https://bugs.gentoo.org/906329 Acked-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Ulrich Müller <ulm@gentoo.org> Closes: https://github.com/gentoo/gcc-config/pull/3 Signed-off-by: Sam James <sam@gentoo.org> gcc-config | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0df09b186df442119518611ad70d3824072f784e commit 0df09b186df442119518611ad70d3824072f784e Author: Sam James <sam@gentoo.org> AuthorDate: 2023-05-14 17:28:53 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-05-14 17:28:53 +0000 sys-devel/gcc-config: add 2.11 Closes: https://bugs.gentoo.org/906329 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc-config/Manifest | 1 + sys-devel/gcc-config/gcc-config-2.11.ebuild | 60 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0f68ff73d9041561855f6bdc232070f30ba5bfc commit b0f68ff73d9041561855f6bdc232070f30ba5bfc Author: Sam James <sam@gentoo.org> AuthorDate: 2024-01-23 05:27:20 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-01-23 05:28:04 +0000 toolchain.eclass: require >=sys-devel/gcc-config-2.11 for portageq fixes Bug: https://bugs.gentoo.org/906329 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)