From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2F8C7158094 for ; Mon, 1 Aug 2022 22:39:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D3315E0D5C; Mon, 1 Aug 2022 22:39:14 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9913FE0BFA for ; Mon, 1 Aug 2022 22:39:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AC9A1340CD8 for ; Mon, 1 Aug 2022 22:39:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D245055F for ; Mon, 1 Aug 2022 22:39:10 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1659393491.1bb1f5dc09f870558703fedbbb7d282830bf4251.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/isolated-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 1bb1f5dc09f870558703fedbbb7d282830bf4251 X-VCS-Branch: master Date: Mon, 1 Aug 2022 22:39:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3a81e720-a4bc-4f75-a964-5c97cb5c630b X-Archives-Hash: a681a9c6baf5a170e14b12ff3a9f8ea7 commit: 1bb1f5dc09f870558703fedbbb7d282830bf4251 Author: Sam James gentoo org> AuthorDate: Thu Jul 28 01:19:41 2022 +0000 Commit: Sam James gentoo org> CommitDate: Mon Aug 1 22:38:11 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1bb1f5dc isolated-functions.sh: sync ___makeopts_jobs with multiprocessing.eclass Signed-off-by: Sam James gentoo.org> Closes: https://github.com/gentoo/portage/pull/871 Signed-off-by: Sam James gentoo.org> bin/isolated-functions.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 4542c6715..0efcd5a7d 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -470,10 +470,11 @@ if [[ -z ${XARGS} ]] ; then fi ___makeopts_jobs() { - # Copied from eutils.eclass:makeopts_jobs() - local jobs - jobs=$(echo " ${MAKEOPTS} " | \ - sed -r -n 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p') || die + # Copied from multiprocessing.eclass:makeopts_jobs + # This assumes the first .* will be more greedy than the second .* + # since POSIX doesn't specify a non-greedy match (i.e. ".*?"). + local jobs=$(echo " ${MAKEOPTS} " | sed -r -n \ + -e 's:.*[[:space:]](-[a-z]*j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' || die) echo ${jobs:-1} }