From a24dfdd4b518e5d196337ffd03ce2ab8f304591d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= Date: Sun, 7 May 2023 23:30:39 +0200 Subject: [PATCH] sys-libs/glibc: Fix parallelization during binpkg install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: https://bugs.gentoo.org/736794 Signed-off-by: Andreas K. Hüttel --- sys-libs/glibc/glibc-9999.ebuild | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index f16a004cdc94d..cc98168d7f92e 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -1271,7 +1271,15 @@ run_locale_gen() { locale_list="${root%/}/usr/share/i18n/SUPPORTED" fi - set -- locale-gen ${inplace} --jobs $(makeopts_jobs) --config "${locale_list}" \ + # bug 736794: we need to be careful with the parallelization... the number of + # processors saved in the environment of a binary package may differ strongly + # from the number of processes available during postinst + local mygenjobs="$(makeopts_jobs)" + if [[ "${EMERGE_FROM}" == "binary" ]] ; then + mygenjobs="$(nproc)" + fi + + set -- locale-gen ${inplace} --jobs "${mygenjobs}" --config "${locale_list}" \ --destdir "${root}" echo "$@" "$@"